Skip to content

Instantly share code, notes, and snippets.

View wiseman's full-sized avatar

John Wiseman wiseman

View GitHub Profile
@Metaxal
Metaxal / logging.rkt
Last active September 10, 2023 09:52
Simple usage of Racket's logging facility
#lang racket/base
; One way to define a logger
(define lg (make-logger 'my-logger))
; Define a receiver for this logger, along with a log level
(define rc (make-log-receiver lg 'error)) ; also try with 'debug
; Another way to define a logger, with additional forms
(define-logger lg2)
(define rc2 (make-log-receiver lg2-logger 'debug))