diff options
author | Christopher Baines <mail@cbaines.net> | 2024-04-19 17:40:17 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-04-19 17:40:17 +0100 |
commit | 6be6f63c9f03b7bc928f7927a38da91f95f57ea2 (patch) | |
tree | bf2c6bfe9de7bc4c41f8bdf4520e299852161d73 /scripts | |
parent | d64b070a8d6cbe9d7d88a73318ce5c97e462ecdb (diff) | |
download | nar-herder-6be6f63c9f03b7bc928f7927a38da91f95f57ea2.tar nar-herder-6be6f63c9f03b7bc928f7927a38da91f95f57ea2.tar.gz |
Fix for guile-lib v0.2.8
I'm not sure quite what's changed, but it seems like the way the
formatter is being called has changed in a backwards incompatible way.
To maintain compatability with both older and newer versions of
guile-lib, accept the formatter being called with extra arguments, and
just look at the first three.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/nar-herder.in | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 67515dc..fafcf9f 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -458,11 +458,14 @@ (port-log (make <port-log> #:port (current-output-port) #:formatter - (lambda (lvl time str) + ;; In guile-lib v0.2.8 onwards, the formatter is + ;; called with more arguments + (lambda args ; lvl, time, str (format #f "~a (~5a): ~a~%" - (strftime "%F %H:%M:%S" (localtime time)) - lvl - str))))) + (strftime "%F %H:%M:%S" (localtime + (second args))) + (first args) + (third args)))))) (add-handler! lgr port-log) (open-log! lgr) @@ -524,11 +527,14 @@ (port-log (make <port-log> #:port (current-output-port) #:formatter - (lambda (lvl time str) + ;; In guile-lib v0.2.8 onwards, the formatter is + ;; called with more arguments + (lambda args ; lvl, time, str (format #f "~a (~5a): ~a~%" - (strftime "%F %H:%M:%S" (localtime time)) - lvl - str)))) + (strftime "%F %H:%M:%S" (localtime + (second args))) + (first args) + (third args))))) (metrics-registry (make-metrics-registry #:namespace "narherder"))) @@ -567,11 +573,14 @@ (port-log (make <port-log> #:port (current-output-port) #:formatter - (lambda (lvl time str) + ;; In guile-lib v0.2.8 onwards, the formatter is + ;; called with more arguments + (lambda args ; lvl, time, str (format #f "~a (~5a): ~a~%" - (strftime "%F %H:%M:%S" (localtime time)) - lvl - str))))) + (strftime "%F %H:%M:%S" (localtime + (second args))) + (first args) + (third args)))))) (add-handler! lgr port-log) (open-log! lgr) |