This library is unstable; compatibility will not be maintained. See Unstable: May Change Without Warning for more information.
|(require unstable/logging)||package: typed-racket-lib|
This module provides tools for logging.
port : output-port? proc : (-> any) log-spec : (or/c 'fatal 'error 'warning 'info 'debug symbol? #f)
Runs proc, outputting any logging that would be received by (make-log-receiver (current-logger) log-spec ...) to port. Returns whatever proc returns.
Runs proc, calling interceptor on any log message that would be received by (make-log-receiver (current-logger) log-spec ...). interceptor receives the entire log vectors (see Receiving Logged Events) as arguments. Returns whatever proc returns.
A lower-level interface to logging is also available.
start-recording starts recording log messages matching the given log-spec (see make-log-receiver for how log-spec is interpreted). Messages will be recorded until stopped by passing the returned listener object to stop-recording. stop-recording will then return a list of the log messages that have been reported.