taoensso / timbre

Pure Clojure/Script logging library
https://www.taoensso.com/timbre
Eclipse Public License 1.0
1.44k stars 171 forks source link

Puzzling clojurescript behaviour #302

Closed gmp26 closed 3 years ago

gmp26 commented 4 years ago

I'm finding it impossible to predict the log level that is active in a clojurescript repl. It's possibly because I don't understand how the eliding is working, but I would expect (debug "foo") to log by default. It doesn't, but (info "foo") works fine, as do warn error etc.

In a figwheel cljs REPL, timbre/config returns:

{:level :debug,
 :ns-whitelist [],
 :ns-blacklist [],
 :middleware [],
 :output-fn #object[taoensso$timbre$default_output_fn],
 :appenders
 {:console
  {:enabled? true,
   :async? false,
   :min-level nil,
   :rate-limit nil, 
   :output-fn :inherit, 
   :fn #object[Function]}}}

If I use (timbre/set-level! :trace), then I do see (trace "foo") output, but I still do not see anything from (debug "foo"). So I'm mystified. The REPL does appear to have a sensible definition of debug.

(macroexpand '(debug "foo"))
(taoensso.timbre/-log!
 taoensso.timbre/*config*
 :debug
 "predict.models.predict"
 "/Users/gmp26/clojure/predict-min/script/repl.clj"
 1 
 :p 
 :auto 
 (clojure.core/delay ["foo"]) 
 nil 
 -991657157)

Any help would be appreciated.

ptaoussanis commented 3 years ago

@gmp26 Hi Mike! Is this still an issue? If so, any chance you could provide a reproducible example?

It sounds like your expectations are correct.

A few things that can influence the output you see:

Hope that helps!

gmp26 commented 3 years ago

Sorry, I stopped using timbre as I could not overcome this issue, so I am now out of context.

ptaoussanis commented 3 years ago

No problem, thanks for the quick response!

leafgarland commented 2 years ago

Hi, I also had this problem and @ptaoussanis comment about the browser's console settings was correct. If I change my browser console to verbose then I can see the debug level output. This makes sense but it is easy to get confused by :trace level output not being filtered.