diff --git a/main.rkt b/main.rkt index 96a6c18..276d1c8 100644 --- a/main.rkt +++ b/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) ) ) ) diff --git a/scrbl/simple-log.scrbl b/scrbl/simple-log.scrbl index 2ac62ba..8ea1e8a 100644 --- a/scrbl/simple-log.scrbl +++ b/scrbl/simple-log.scrbl @@ -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. @@ -151,4 +151,4 @@ creates: @defproc[#:link-target? #f (fatal-my-module [msg string?] [arg any/c] ...) void?]{Fatal log.} -All use @racket[format] and emit asynchronously. \ No newline at end of file +All use @racket[format] and emit asynchronously.