Skip to content

Commit

Permalink
Housekeeping for [#151]
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Feb 26, 2016
1 parent eefad45 commit fd0553d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/taoensso/timbre.cljx
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,17 @@

(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 (def ^:private compile-time-level
(have [:or nil? valid-level]
(keyword (or (env-val "TIMBRE_LEVEL")
(env-val "TIMBRE_LOG_LEVEL")))))
#+clj
(defn- sys-val [id]
(when-let [s (or (System/getProperty id)
(System/getenv id))]
(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

Expand Down Expand Up @@ -209,8 +215,8 @@

#+clj
(def ^:private compile-time-ns-filter
(let [whitelist (have [:or nil? vector?] (env-val "TIMBRE_NS_WHITELIST"))
blacklist (have [:or nil? vector?] (env-val "TIMBRE_NS_BLACKLIST"))]
(let [whitelist (have [:or nil? vector?] (sys-val "TIMBRE_NS_WHITELIST"))
blacklist (have [:or nil? vector?] (sys-val "TIMBRE_NS_BLACKLIST"))]

(when compile-time-level
(println (str "Compile-time (elision) Timbre level: " compile-time-level)))
Expand Down

0 comments on commit fd0553d

Please sign in to comment.