Add clojure/timbre_config.clj
This commit is contained in:
parent
be5bbd84ed
commit
9ff1621d83
18
clojure/timbre_config.clj
Normal file
18
clojure/timbre_config.clj
Normal file
|
@ -0,0 +1,18 @@
|
|||
(ns timbre-config
|
||||
(:require
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
(defn output-fn
|
||||
([ data] (output-fn nil data))
|
||||
([opts data]
|
||||
(let [{:keys [no-stacktrace? stacktrace-fonts]} opts
|
||||
{:keys [level ?err msg_ ?ns-str ?file hostname_ timestamp_ ?line]} data]
|
||||
(str
|
||||
(str (force timestamp_) " ")
|
||||
(string/upper-case (name level)) " "
|
||||
"[" (or ?ns-str ?file "?") ":" (or ?line "?") "] -"
|
||||
(force msg_)))))
|
||||
|
||||
(log/merge-config! {:output-fn output-fn})
|
||||
|
||||
(log/info "Hello World")
|
Loading…
Reference in a new issue