23 Logging tools
Utilities for simple logging of messages in an application-specific format.
| |||||
name : symbol? |
A structure representing a particular stream of log messages.
Default log stream for normal messages.
Default log stream for warning messages.
Default log stream for error messages.
(current-log-preamble) → (-> list?) |
(current-log-preamble preamble-ref) → void? |
preamble-ref : (-> list?) |
Parameter for controlling the standard preamble printed with each log message. preamble-ref is thunk that returns a list of values to be included at the begining of each log message.
Examples: | ||||
> (log-message "string" 123 'symbol) | ||||
M,"string",123,symbol | ||||
#(struct:tm:time time-tai 9820000 1213353705) | ||||
| ||||
| ||||
#(struct:tm:time time-tai 9850000 1213353705) |
Syntactic shorthand for:
(parameterize ([current-log-preamble thunk]) |
expr ) |
(current-log-port) → (U output-port? (-> output-port?)) |
(current-log-port port+thunk) → void? |
port+thunk : (U output-port? (-> output-port?)) |
Parameter that controls the output-port to which to print log messages. port+thunk is either an output port or a thunk that returns an output port (useful, for example, for tying current-log-port to current-output-port or current-error-port).
Syntactic shorthand for:
(parameterize ([current-log-port port+thunk]) |
expr ) |
log : log-stream? |
args : list |
Prints a message to log containing the stream name, the current-log-preamble and any args, and returns the current time as a SRFI 19 time structure.
Examples: |
> (log-generic message-log (list "string" 123 'symbol)) |
M,"string",123,symbol |
#(struct:tm:time time-tai 9890000 1213353705) |
> (log-generic warning-log (list "string" 123 'symbol)) |
W,"string",123,symbol |
#(struct:tm:time time-tai 9900000 1213353705) |
> (log-generic error-log (list "string" 123 'symbol)) |
E,"string",123,symbol |
#(struct:tm:time time-tai 9900000 1213353705) |
arg : any |
Shorthand for (log-generic message-log (list any ...)).
arg : any |
Shorthand for (log-generic warning-log (list any ...)).
arg : any |
Shorthand for (log-generic error-log (list any ...)).