diff --git a/log4cl-extras.asd b/log4cl-extras.asd index c1bb406..373f0d1 100644 --- a/log4cl-extras.asd +++ b/log4cl-extras.asd @@ -11,8 +11,7 @@ ;; additional dependency system :secret-values ;; ;; "log4cl-extras/secrets" - "log4cl-extras/config" - "log4cl-extras/error") + "log4cl-extras/core") :description "A bunch of addons to LOG4CL: JSON appender, context fields, cross-finger appender, etc." :long-description " diff --git a/qlfile.lock b/qlfile.lock index dd61e59..beded05 100644 --- a/qlfile.lock +++ b/qlfile.lock @@ -1,8 +1,8 @@ ("quicklisp" . (:class qlot/source/dist:source-dist :initargs (:distribution "http://beta.quicklisp.org/dist/quicklisp.txt" :%version :latest) - :version "2023-02-15")) + :version "2023-10-21")) ("ultralisp" . (:class qlot/source/dist:source-dist :initargs (:distribution "http://dist.ultralisp.org/" :%version :latest) - :version "20230422190002")) + :version "20231119095000")) diff --git a/src/appenders.lisp b/src/appenders.lisp index ac52414..b95247a 100644 --- a/src/appenders.lisp +++ b/src/appenders.lisp @@ -1,14 +1,21 @@ (defpackage #:log4cl-extras/appenders (:use #:cl) (:import-from #:log4cl) + (:import-from #:global-vars + #:define-global-var) (:export #:stable-daily-file-appender #:stable-this-console-appender #:dont-disable-mixin - #:stable-file-appender)) + #:stable-file-appender + #:*debug-on-error*)) (in-package log4cl-extras/appenders) +(define-global-var *debug-on-error* nil + "When T, then INVOKE-DEBUGGER will be called in case of any error during logging the message.") + + (defclass dont-disable-mixin () ()) @@ -31,4 +38,6 @@ "~@" (type-of condition) condition)) + (when *debug-on-error* + (invoke-debugger condition)) :ignore) diff --git a/src/changelog.lisp b/src/changelog.lisp index feef822..7ba2fdc 100644 --- a/src/changelog.lisp +++ b/src/changelog.lisp @@ -16,7 +16,20 @@ ":JSON" ":PLAIN" "HTTP" + "ASDF" "TRACEBACK-TO-STRING")) + (0.10.0 2023-11-19 + " +## New + +Variable LOG4CL-EXTRAS/APPENDERS:*DEBUG-ON-ERROR* was added and can be used to debug issues happening when handling log messages. +When this option is NIL, appenders defined in log4cl-extras will only output \"Unable to log the message\" message in case of errors +during the message output. + +## Fixes + +* Package log4cl-extras now is created when library is loaded. This should fix a warning from ASDF about missing package. +") (0.9.0 2022-12-30 "Function LOG4CL-EXTRAS/ERROR:PRINT-BACKTRACE now prints conditions with type like: diff --git a/src/core.lisp b/src/core.lisp new file mode 100644 index 0000000..af0f402 --- /dev/null +++ b/src/core.lisp @@ -0,0 +1,6 @@ +(uiop:define-package #:log4cl-extras + (:use #:cl) + (:nicknames #:log4cl-extras/core) + (:import-from #:log4cl-extras/config) + (:import-from #:log4cl-extras/error)) +(in-package #:log4cl-extras)