The log level is always in uppercase, and its surrounding parentheses
  are dropped.

* src/logging/logger.scm (default-log-formatter): Uppercase level and
  strip its surrounding parens.

* unit-tests/logging.logger.scm: Adjust expected output accordingly.
---

(no changes since v1)

 src/logging/logger.scm        | 2 +-
 unit-tests/logging.logger.scm | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/logging/logger.scm b/src/logging/logger.scm
index e53661d..6a5b824 100644
--- a/src/logging/logger.scm
+++ b/src/logging/logger.scm
@@ -296,7 +296,7 @@ suitable syntax wrapper (currently left to the user to 
implement)."
         ;; '(standards) Errors').
         (line      (and=> (assoc-ref source-properties 'line) 1+))
         (column    (assoc-ref source-properties 'column)))
-    (format #f "~a ~@[~a ~](~a): ~a~%"
+    (format #f "~a ~@[~a ~]~:@(~a~): ~a~%"
             (strftime "%F %H:%M:%S" (localtime time))
             (and (or file-name line column)
                 (format #f "~@[~a:~]~@[~a:~]~@[~a:~]" file-name line column))
diff --git a/unit-tests/logging.logger.scm b/unit-tests/logging.logger.scm
index d26587c..2093bf2 100644
--- a/unit-tests/logging.logger.scm
+++ b/unit-tests/logging.logger.scm
@@ -30,7 +30,7 @@
          (lgr     (make <logger> #:handlers (list (make <port-log> #:port 
strport)))))
     (open-log! lgr)
     (log-msg lgr 'CRITICAL "Hello!")
-    (assert-equal "(CRITICAL): Hello!\n"
+    (assert-equal "CRITICAL: Hello!\n"
                   ;; skip over the time/date, since that will vary!
                   (substring (get-output-string strport) 20))))
 
@@ -41,7 +41,7 @@
     (set-default-logger! lgr)
     (log-msg 'CRITICAL "Hello!")
     (set-default-logger! #f)
-    (assert-equal "(CRITICAL): Hello!\n"
+    (assert-equal "CRITICAL: Hello!\n"
                   ;; skip over the time/date, since that will vary!
                   (substring (get-output-string strport) 20))))
 
@@ -50,7 +50,7 @@
          (lgr     (make <logger> #:handlers (list (make <port-log> #:port 
strport)))))
     (register-logger! "main" lgr)
     (log-msg (lookup-logger "main") 'CRITICAL "Hello!")
-    (assert-equal "(CRITICAL): Hello!\n"
+    (assert-equal "CRITICAL: Hello!\n"
                   ;; skip over the time/date, since that will vary!
                   (substring (get-output-string strport) 20))))
 
-- 
2.41.0


Reply via email to