Skip to content

Commit

Permalink
[wip] Add temporary timbre->telemere appender
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Dec 20, 2024
1 parent 07e4e38 commit 37b7a66
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions projects/main/src/taoensso/telemere/timbre.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,32 @@
(defn shutdown-appenders!
"Prefer `telemere/stop-handlers!`."
[] (tel/stop-handlers!))

;;;; @TODO To wiki

(comment
(defn timbre->telemere-appender
"Returns a simple Timbre appender that'll redirect logs to Telemere."
[]
{:enabled? true
:min-level nil
:fn
(fn [data]
(let [{:keys [instant level context ?err output_
?ns-str ?file ?line ?column]} data]

(taoensso.telemere/signal!
{:kind :log
:via-timbre? true ; User-level kv to help identify these signals

:level level
:inst (taoensso.encore/as-?inst instant)
:ctx+ context

:ns ?ns-str
:file ?file
:line ?line
:column ?column

:error ?err
:msg (force output_)})))}))

0 comments on commit 37b7a66

Please sign in to comment.