js console appender: allow raw arg switch

This commit is contained in:
Peter Taoussanis 2015-05-26 18:04:49 +07:00
parent 7c969ca0e6
commit 745d10d4ce
1 changed files with 8 additions and 3 deletions

View File

@ -164,14 +164,19 @@
(if-not have-logger?
(fn [data] nil)
(fn [data]
(let [{:keys [level appender-opts output-fn]} data
(let [{:keys [level appender-opts output-fn vargs_]} data
{:keys []} appender-opts
output (output-fn data)]
vargs (force vargs_)
[v1 vnext] (enc/vsplit-first vargs)
output (if (= v1 :timbre/raw)
(into-array vnext)
(output-fn data))]
(case (adjust-level level)
:error (.error js/console output)
:warn (.warn js/console output)
(.log js/console output))))))}}})
(.log js/console output))))))}}})
(comment
(set-config! example-config)