Housekeeping: ccb5b3e (Android appender)

This commit is contained in:
Peter Taoussanis 2013-11-09 15:40:57 +07:00
parent 1df74f9ab1
commit 71712fff5f
1 changed files with 16 additions and 17 deletions

View File

@ -5,9 +5,10 @@
(:require [taoensso.timbre :as timbre]))
(def logcat-appender
{:doc (str "Appends to android logcat. Obviously only works if "
"running within the android runtime, either on a device "
"or an emulator")
{:doc (str "Appends to Android logcat. Obviously only works if "
"running within the Android runtime (device or emulator)."
"You may want to disable std-out to prevent printing nested "
"timestamps, etc.")
:min-level :debug
:enabled? true
:async? false
@ -15,22 +16,20 @@
:prefix-fn :ns
:fn (fn [{:keys [level prefix throwable message]}]
(if throwable
(condp = level
(case level
:trace (android.util.Log/d prefix message throwable)
:debug (android.util.Log/d prefix message throwable)
:info (android.util.Log/i prefix message throwable)
:warn (android.util.Log/w prefix message throwable)
:error (android.util.Log/e prefix message throwable)
:fatal (android.util.Log/e prefix message throwable)
:warn (android.util.Log/w prefix message throwable)
:info (android.util.Log/i prefix message throwable)
:report (android.util.Log/i prefix message throwable)
:debug (android.util.Log/d prefix message throwable)
:report (android.util.Log/d prefix message throwable)
:trace (android.util.Log/d prefix message throwable))
:report (android.util.Log/i prefix message throwable))
(condp = level
(case level
:trace (android.util.Log/d prefix message)
:debug (android.util.Log/d prefix message)
:info (android.util.Log/i prefix message)
:warn (android.util.Log/w prefix message)
:error (android.util.Log/e prefix message)
:fatal (android.util.Log/e prefix message)
:warn (android.util.Log/w prefix message)
:info (android.util.Log/i prefix message)
:report (android.util.Log/i prefix message)
:debug (android.util.Log/d prefix message)
:report (android.util.Log/d prefix message)
:trace (android.util.Log/d prefix message))))})
:report (android.util.Log/i prefix message))))})