diff --git a/src/taoensso/timbre/appenders/android.clj b/src/taoensso/timbre/appenders/android.clj index 1c3ac20..1b597db 100644 --- a/src/taoensso/timbre/appenders/android.clj +++ b/src/taoensso/timbre/appenders/android.clj @@ -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))))})