[#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:
Dom Kiva-Meyer 2016-02-08 12:17:52 -08:00 committed by Peter Taoussanis
parent acf9ee8563
commit eefad451d7
1 changed files with 1 additions and 1 deletions

View File

@ -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")