mirror of https://github.com/status-im/timbre.git
Add `merge-config!`
This commit is contained in:
parent
f23b59119d
commit
222be9d48e
|
@ -44,8 +44,9 @@
|
||||||
|
|
||||||
Other keys include: :instant, :timestamp, :hostname, :ns, :error?
|
Other keys include: :instant, :timestamp, :hostname, :ns, :error?
|
||||||
|
|
||||||
See source code for examples and `utils/deep-merge` for a convenient way
|
See source code for examples.
|
||||||
to reconfigure appenders."
|
See `set-config!`, `merge-config!`, `set-level!` for convenient config
|
||||||
|
editing."
|
||||||
(atom {:current-level :debug
|
(atom {:current-level :debug
|
||||||
|
|
||||||
;;; Control log filtering by namespace patterns (e.g. ["my-app.*"]).
|
;;; Control log filtering by namespace patterns (e.g. ["my-app.*"]).
|
||||||
|
@ -88,6 +89,7 @@
|
||||||
(catch java.io.IOException _))))}}}))
|
(catch java.io.IOException _))))}}}))
|
||||||
|
|
||||||
(defn set-config! [[k & ks] val] (swap! config assoc-in (cons k ks) val))
|
(defn set-config! [[k & ks] val] (swap! config assoc-in (cons k ks) val))
|
||||||
|
(defn merge-config! [& maps] (apply swap! config utils/deep-merge maps))
|
||||||
(defn set-level! [level] (set-config! [:current-level] level))
|
(defn set-level! [level] (set-config! [:current-level] level))
|
||||||
|
|
||||||
;;;; Define and sort logging levels
|
;;;; Define and sort logging levels
|
||||||
|
|
Loading…
Reference in New Issue