logging: allow name in `log-message', report it in a log-receiver evt
The synchronization result of a log receiver is now a vector of four values, instead of three, where the last one reports the name. Also, an optional argument to `make-logger' provides a notification callback for each event sent to the logger. These changes enable more control over loggers and events. Suppose that you have processes A and B, and you want all log events of A to be visible to B, but not vice-versa. Furthermore, you want the log events to appear at B in the right order: if A logs an event before B, then A's event should arrive at a log receiver's before B's. Now that a log receiver gets the name associated with the original event, and now that the name can be re-sent in a `log-receiver', it's possible to give A and B separate loggers and send all of the events from A's logger to B's logger. Furthermore, you can use the notification callback so that when an event is logged in B, you can make sure that all available events from from A's logger have been transferred to B's logger. original commit: f2d870859aad7cf21d96f81f1f9dfc0eae8adaa7
This commit is contained in:
parent
592e802ad0
commit
ffd81f136f
|
@ -2108,7 +2108,8 @@
|
|||
[logger-name (-> -Logger (-opt Sym))]
|
||||
[current-logger (-Param -Logger -Logger)]
|
||||
|
||||
[log-message (-> -Logger -Log-Level -String Univ -Void)]
|
||||
[log-message (Un (-> -Logger -Log-Level -String Univ -Void)
|
||||
(-> -Logger -Log-Level (Un (-val #f) -Symbol) -String Univ -Void))]
|
||||
[log-level? (-> -Logger -Log-Level B)]
|
||||
|
||||
[log-receiver? (make-pred-ty -Log-Receiver)]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
(define level/c (or/c 'fatal 'error 'warning 'info 'debug))
|
||||
(define log-spec/c (listof (or/c symbol? #f)))
|
||||
(define log-message/c (vector/c level/c string? any/c))
|
||||
(define log-message/c (vector/c level/c string? any/c (or/c symbol? #f)))
|
||||
|
||||
;; helper used below
|
||||
(define (receiver-thread receiver stop-chan intercept)
|
||||
|
|
Loading…
Reference in New Issue
Block a user