aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-05-15 19:22:35 +0100
committerChristopher Baines <mail@cbaines.net>2024-05-15 19:22:35 +0100
commit7df2aa647d11342e3a446f44ef7626e58a1d5902 (patch)
tree72853e4c80775fc70f075bfbb05035f5863d86db
parent06fca5d1772469d163bbf165801ed547e0290f1c (diff)
downloadbffe-7df2aa647d11342e3a446f44ef7626e58a1d5902.tar
bffe-7df2aa647d11342e3a446f44ef7626e58a1d5902.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.
-rw-r--r--bffe.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/bffe.scm b/bffe.scm
index fa185ee..beba5c4 100644
--- a/bffe.scm
+++ b/bffe.scm
@@ -17,6 +17,7 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (bffe)
+ #:use-module (srfi srfi-1)
#:use-module (ice-9 format)
#:use-module (oop goops)
#:use-module (prometheus)
@@ -45,11 +46,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))))))
(setvbuf (current-output-port) 'line)