mirror of https://github.com/status-im/timbre.git
[#151] Allow compile-time log level to be set with system property
This is useful since it allows one to dynamically set the log level prior to ClojureScript compilation. Specifically, I would like to use this inside of a Boot task.
This commit is contained in:
parent
acf9ee8563
commit
eefad451d7
|
@ -160,7 +160,7 @@
|
||||||
|
|
||||||
(comment (qb 10000 (level>= :info :debug)))
|
(comment (qb 10000 (level>= :info :debug)))
|
||||||
|
|
||||||
#+clj (defn- env-val [id] (when-let [s (System/getenv id)] (enc/read-edn s)))
|
#+clj (defn- env-val [id] (when-let [s (or (System/getProperty id) (System/getenv id))] (enc/read-edn s)))
|
||||||
#+clj (def ^:private compile-time-level
|
#+clj (def ^:private compile-time-level
|
||||||
(have [:or nil? valid-level]
|
(have [:or nil? valid-level]
|
||||||
(keyword (or (env-val "TIMBRE_LEVEL")
|
(keyword (or (env-val "TIMBRE_LEVEL")
|
||||||
|
|
Loading…
Reference in New Issue