Version: 5.3
18 Logging
This library is unstable;
compatibility will not be maintained.
See Unstable: May Change Without Warning for more information.
(require unstable/logging) |
This module provides tools for logging.
procedure
(with-logging-to-port port proc [ #:level level]) → any port : output-port? proc : (-> any) level : (or/c 'fatal 'error 'warning 'info 'debug) = 'debug
Runs proc, outputting any logging of level level or higher to
port. Returns whatever proc returns.
Example: | |||||||||
|
procedure
(with-intercepted-logging interceptor proc [ #:level level]) → any
interceptor :
(-> (vector/c (or/c 'fatal 'error 'warning 'info 'debug) string? any/c) any) proc : (-> any) level : (or/c 'fatal 'error 'warning 'info 'debug) = 'debug
Runs proc, calling interceptor on any log message of level
level or higher. interceptor receives the entire log vectors
(see Receiving Logged Events)
as arguments. Returns whatever proc returns.
Example: | ||||||||||||||
|
A lower-level interface to logging is also available.
procedure
(start-recording [#:level level]) → listener?
level : (or/c 'fatal 'error 'warning 'info 'debug) = 'debug
procedure
(stop-recording listener)
→
(listof (vector/c (or/c 'fatal 'error 'warning 'info 'debug) string? any/c)) listener : listener?
start-recording starts recording log messages of the desired level or
higher. 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.
Examples: | |||||||||||||||
|