-
This commit is contained in:
8
main.rkt
8
main.rkt
@@ -159,7 +159,7 @@
|
||||
|
||||
(define-syntax (sl-def-log stx)
|
||||
(syntax-case stx (log-callbacks)
|
||||
((_ id parent prefix)
|
||||
((_ id prefix parent)
|
||||
(with-syntax ([receiver (format-id #'id "receiver-~a" #'prefix)]
|
||||
[dbg-name (format-id #'id "dbg-~a" #'prefix)]
|
||||
[info-name (format-id #'id "info-~a" #'prefix)]
|
||||
@@ -170,11 +170,11 @@
|
||||
#'(def-log2 id parent receiver log-callbacks dbg-name info-name warn-name err-name fatal-name)
|
||||
)
|
||||
)
|
||||
((_ id parent)
|
||||
#'(sl-def-log id parent id)
|
||||
((_ id name)
|
||||
#'(sl-def-log id name #f)
|
||||
)
|
||||
((_ id)
|
||||
#'(sl-def-log id #f id)
|
||||
#'(sl-def-log id id #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@ registered callbacks.
|
||||
@defmodule["simple-log"]
|
||||
|
||||
@defform*[((sl-def-log id)
|
||||
(sl-def-log id parent)
|
||||
(sl-def-log id parent prefix))]{
|
||||
(sl-def-log id name)
|
||||
(sl-def-log id name parent))]{
|
||||
|
||||
Defines a logger with topic @racket['id] and creates:
|
||||
|
||||
@@ -28,7 +28,7 @@ Defines a logger with topic @racket['id] and creates:
|
||||
@item{@racket[fatal-id]}
|
||||
]
|
||||
|
||||
Note. If prefix is given, id @racket[dbg-prefix], etc. will be generated instead of @racket[dbg-id], etc.
|
||||
Note. If name is given, id @racket[dbg-prefix], etc. will be generated instead of @racket[dbg-id], etc.
|
||||
|
||||
Each procedure has shape:
|
||||
|
||||
@@ -39,7 +39,7 @@ Each procedure has shape:
|
||||
The message is formatted via @racket[format] and emitted with a timestamp
|
||||
(@litchar{YYYY-MM-DDTHH:MM:SS}) and topic @racket['id].
|
||||
|
||||
If @racket[parent] is omitted, the current logger is used.
|
||||
If @racket[parent] is omitted, the @racket[#f] is used as "parent logger".
|
||||
|
||||
A background thread is started that receives log events and forwards them
|
||||
to the registered callbacks.
|
||||
|
||||
Reference in New Issue
Block a user