Housekeeping for [#151]

This commit is contained in:
Peter Taoussanis 2016-02-09 09:51:09 +07:00
parent eefad451d7
commit fd0553df0d
1 changed files with 13 additions and 7 deletions

View File

@ -160,11 +160,17 @@
(comment (qb 10000 (level>= :info :debug))) (comment (qb 10000 (level>= :info :debug)))
#+clj (defn- env-val [id] (when-let [s (or (System/getProperty id) (System/getenv id))] (enc/read-edn s))) #+clj
#+clj (def ^:private compile-time-level (defn- sys-val [id]
(have [:or nil? valid-level] (when-let [s (or (System/getProperty id)
(keyword (or (env-val "TIMBRE_LEVEL") (System/getenv id))]
(env-val "TIMBRE_LOG_LEVEL"))))) (enc/read-edn s)))
#+clj
(def ^:private compile-time-level
(have [:or nil? valid-level]
(keyword (or (sys-val "TIMBRE_LEVEL")
(sys-val "TIMBRE_LOG_LEVEL")))))
;;;; ns filter ;;;; ns filter
@ -209,8 +215,8 @@
#+clj #+clj
(def ^:private compile-time-ns-filter (def ^:private compile-time-ns-filter
(let [whitelist (have [:or nil? vector?] (env-val "TIMBRE_NS_WHITELIST")) (let [whitelist (have [:or nil? vector?] (sys-val "TIMBRE_NS_WHITELIST"))
blacklist (have [:or nil? vector?] (env-val "TIMBRE_NS_BLACKLIST"))] blacklist (have [:or nil? vector?] (sys-val "TIMBRE_NS_BLACKLIST"))]
(when compile-time-level (when compile-time-level
(println (str "Compile-time (elision) Timbre level: " compile-time-level))) (println (str "Compile-time (elision) Timbre level: " compile-time-level)))