From 2822efe513ffc5559cbfc3ee8a0ca2c3ecb901af Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Sat, 23 Jul 2016 11:56:31 +0700 Subject: [PATCH] Cljs console appender: allow late .-log binding --- src/taoensso/timbre/appenders/core.cljx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/taoensso/timbre/appenders/core.cljx b/src/taoensso/timbre/appenders/core.cljx index a015efe..73564b2 100644 --- a/src/taoensso/timbre/appenders/core.cljx +++ b/src/taoensso/timbre/appenders/core.cljx @@ -112,7 +112,7 @@ :rate-limit nil :output-fn :inherit :fn - (if (and (exists? js/console) js/console.log) + (if (exists? js/console) (let [;; Don't cache this; some libs dynamically replace js/console level->logger (fn [level] @@ -128,7 +128,7 @@ js/console.log))] (fn [data] - (let [logger (level->logger (:level data))] + (when-let [logger (level->logger (:level data))] (if (or (:raw-console? data) (get-in data [:?meta :raw-console?])) ; Undocumented