From 7df2aa647d11342e3a446f44ef7626e58a1d5902 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 15 May 2024 19:22:35 +0100 Subject: 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. --- bffe.scm | 12 ++++++++---- 1 file 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 @@ ;;; . (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 (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) -- cgit v1.2.3