fzakaria / slf4j-timbre

SLF4J binding for Clojure's Timbre
Eclipse Public License 1.0
94 stars 24 forks source link

Regression for timbre v6 #67

Open vincentjames501 opened 1 year ago

vincentjames501 commented 1 year ago

On v5, this line of code (https://github.com/fzakaria/slf4j-timbre/blob/master/src/slf4j_timbre/factory.clj#L15) outputs:

(require '[taoensso.timbre :as timbre])
=> nil
(= timbre/*config* (var-get (resolve 'taoensso.timbre/example-config)))
=> true
timbre/*config*
=>
{:min-level :debug,
 :ns-filter #{"*"},
 :middleware [],
 :timestamp-opts {:pattern :iso8601, :locale :jvm-default, :timezone :utc},
 :output-fn #object[taoensso.timbre$default_output_fn 0x2907b20b "taoensso.timbre$default_output_fn@2907b20b"],
 :appenders {:println {:enabled? true,
                       :async? false,
                       :min-level nil,
                       :rate-limit nil,
                       :output-fn :inherit,
                       :fn #object[taoensso.timbre.appenders.core$println_appender$fn__5755
                                   0x320defc8
                                   "taoensso.timbre.appenders.core$println_appender$fn__5755@320defc8"]}}}

on v6 it outputs:

(require '[taoensso.timbre :as timbre])
=> nil
(= timbre/*config* (var-get (resolve 'taoensso.timbre/example-config)))
=> false
timbre/*config*
=>
{:min-level :debug,
 :ns-filter #{"*"},
 :middleware [],
 :timestamp-opts {:pattern :iso8601, :locale :jvm-default, :timezone :utc},
 :output-fn #object[taoensso.timbre$default_output_fn 0x53b7e015 "taoensso.timbre$default_output_fn@53b7e015"],
 :appenders {:println {:enabled? true,
                       :fn #object[taoensso.timbre.appenders.core$println_appender$fn__5835
                                   0x512839d8
                                   "taoensso.timbre.appenders.core$println_appender$fn__5835@512839d8"]}},
 :_init-config {:loaded-from-source :default, :compile-time-config {:min-level nil, :ns-pattern "*"}}}

This is because :_init-config is now present in timbre/*config* but not in (var-get (resolve 'taoensso.timbre/example-config)).

Because of this, it causes https://github.com/fzakaria/slf4j-timbre/issues/32 to come back with v6 of timbre and the latest version of this library.

ptaoussanis commented 2 months ago

@vincentjames501 Hi Vincent - in case this is still relevant for you, you might want to try Timbre v6.6.0-RC1 which now includes built-in SLF4J(v2) support that'll always be automatically kept in-sync with the latest Timbre release.

vincentjames501 commented 2 months ago

@ptaoussanis , this is great! We'll roll this into our internal logging library that leverages timbre soon. Thanks again!