Merge branch 'master' of github.com:ptaoussanis/timbre into dev

This commit is contained in:
Peter Taoussanis 2014-05-06 13:11:43 +07:00
commit c3a9128761
1 changed files with 10 additions and 3 deletions

View File

@ -396,6 +396,11 @@
}))
nil))
(def ^:dynamic *config-dynamic* nil)
(defmacro with-logging-config
"Allows thread-local logging config override. Useful for dev & testing."
[config & body] `(binding [*config-dynamic* ~config] ~@body))
(defmacro log* "Implementation detail."
{:arglists '([base-appender-args msg-type level & log-args]
[base-appender-args msg-type config level & log-args])}
@ -411,7 +416,7 @@
`(let [;;; Support [level & log-args], [config level & log-args] sigs:
s1# ~s1
default-config?# (levels-scored s1#)
config# (if default-config?# @config s1#)
config# (if default-config?# (or *config-dynamic* @config) s1#)
level# (if default-config?# s1# ~s2)
compile-time-ns# ~(str *ns*)]
;; (println "DEBUG: Runtime level check")
@ -494,7 +499,8 @@
'[taoensso.timbre :as timbre
:refer (log trace debug info warn error fatal report
logf tracef debugf infof warnf errorf fatalf reportf
spy logged-future with-log-level sometimes)])
spy logged-future with-log-level with-logging-config
sometimes)])
(require
'[taoensso.timbre.profiling :as profiling
:refer (pspy pspy* profile defnp p p*)])"
@ -503,7 +509,8 @@
'[taoensso.timbre :as timbre
:refer (log trace debug info warn error fatal report
logf tracef debugf infof warnf errorf fatalf reportf
spy logged-future with-log-level sometimes)])
spy logged-future with-log-level with-logging-config
sometimes)])
(require
'[taoensso.timbre.profiling :as profiling
:refer (pspy pspy* profile defnp p p*)]))