flush output when logging
This commit is contained in:
parent
13e6eba161
commit
77d012e69a
|
@ -57,11 +57,13 @@
|
||||||
[_ "<7>"]))
|
[_ "<7>"]))
|
||||||
|
|
||||||
;; in UTC
|
;; in UTC
|
||||||
(define time-str (date->string (seconds->date (* 0.001 (current-inexact-milliseconds)) #f) #t))
|
(define time-str
|
||||||
|
(date->string (seconds->date (* 0.001 (current-inexact-milliseconds)) #f) #t))
|
||||||
;; prefix each line of the log entry with the metadata
|
;; prefix each line of the log entry with the metadata
|
||||||
(define msg-lines (string-split msg "\n"))
|
(define msg-lines (string-split msg "\n"))
|
||||||
(for ([line (in-list msg-lines)])
|
(for ([line (in-list msg-lines)])
|
||||||
(printf "~a[~aZ] [~a] ~a\n" prefix-str time-str level-str line))))
|
(printf "~a[~aZ] [~a] ~a\n" prefix-str time-str level-str line)
|
||||||
|
(flush-output (current-output-port)))))
|
||||||
|
|
||||||
;; process log entries until told to stop
|
;; process log entries until told to stop
|
||||||
;; this uses the same technique as with-intercepted-logging
|
;; this uses the same technique as with-intercepted-logging
|
||||||
|
|
Loading…
Reference in New Issue