Logging
| (require "simple-log") | package: base |
1 Overview
Small wrapper around logger with per-logger callbacks.
A logger consists of a logger, a +log-receiver (level 'debug), a mutable +callback list, five logging procedures, and a background thread +dispatching messages.
2 Definition
Creates:
(make-logger 'id parent)
(make-log-receiver ... 'debug)
callback list
procedures dbg-id, info-id, +warn-id, err-id, fatal-id
Starts a thread that syncs on the receiver and forwards +messages to callbacks.
3 Logging functions
Formats with (apply format (cons msg args)) and calls +log-message.
Attached data:
(list (iso-timestamp) 'id)
4 Callbacks
Callback signature:
5 Output helpers
topic:level:timestamp:message |