diff --git a/crossfire/logging.rkt b/crossfire/logging.rkt index f83f298..8200f75 100644 --- a/crossfire/logging.rkt +++ b/crossfire/logging.rkt @@ -57,11 +57,13 @@ [_ "<7>"])) ;; 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 (define msg-lines (string-split msg "\n")) (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 ;; this uses the same technique as with-intercepted-logging