amperity / dialog

Simple just-enough logging library for Clojure
MIT License
39 stars 2 forks source link

Is dialog a drop in replacement for timbre API ? #13

Closed ieugen closed 1 year ago

ieugen commented 2 years ago

Hi,

We are using timbre and looking at dialog because we can't have unified logging with timbre. We are using slf4j-timbre but I can't filter out apache loggers. Also the library is not in sync with timbre and there is also https://github.com/fzakaria/slf4j-timbre/issues/40 .

p.s. Implementing slf4j API I don't expect dialog to work in CLJS as timbre does.

greglook commented 2 years ago

Depends on how you're consuming Timbre - dialog provides the same set of trace/debug/info/warn/error/fatal "print" loggers as well as the corresponding infof etc "format" loggers. This also matches the API provided by clojure.tools.logging, so if you're using that style of logging then things shouldn't need much if any changes.

For more structured logging, you'd use dialog.logger/log-event to provide maps with key/value entries, some of which are the standard :level, :logger, :message, etc. This is the equivalent of timbre/log! function, if I am reading the code correctly.

ieugen commented 2 years ago

I found that dialog.logger does not contain log or spy from timbre.