This commit is contained in:
Peter Taoussanis 2013-12-01 19:59:09 +07:00
parent 28e5490480
commit 05326dcfae
2 changed files with 8 additions and 7 deletions

View File

@ -95,7 +95,7 @@ This is the biggest win over Java logging utilities IMO. Here's `timbre/example-
:output ; Output of `fmt-output-fn`, used by built-in appenders :output ; Output of `fmt-output-fn`, used by built-in appenders
; as final, formatted appender output. Appenders may (but ; as final, formatted appender output. Appenders may (but
; are not obligated to) use this as their output. ; are not obligated to) use this as their output.
:ap-config ; `shared-appender-config`. :ap-config ; Contents of config's :shared-appender-config key.
:profile-stats ; From `profile` macro. :profile-stats ; From `profile` macro.
:instant ; java.util.Date. :instant ; java.util.Date.
:timestamp ; String generated from :timestamp-pattern, :timestamp-locale. :timestamp ; String generated from :timestamp-pattern, :timestamp-locale.
@ -140,14 +140,14 @@ This is the biggest win over Java logging utilities IMO. Here's `timbre/example-
{:standard-out {:standard-out
{:doc "Prints to *out*/*err*. Enabled by default." {:doc "Prints to *out*/*err*. Enabled by default."
:min-level nil :enabled? true :async? false :rate-limit nil :min-level nil :enabled? true :async? false :rate-limit nil
:fn (fn [{:keys [error? output]}] :fn (fn [{:keys [error? output]}] ; Use any appender args
(binding [*out* (if error? *err* *out*)] (binding [*out* (if error? *err* *out*)]
(str-println output)))} (str-println output)))}
:spit :spit
{:doc "Spits to `(:spit-filename :shared-appender-config)` file." {:doc "Spits to `(:spit-filename :shared-appender-config)` file."
:min-level nil :enabled? false :async? false :rate-limit nil :min-level nil :enabled? false :async? false :rate-limit nil
:fn (fn [{:keys [ap-config output]}] :fn (fn [{:keys [ap-config output]}] ; Use any appender args
(when-let [filename (:spit-filename ap-config)] (when-let [filename (:spit-filename ap-config)]
(try (spit filename output :append true) (try (spit filename output :append true)
(catch java.io.IOException _))))}}}) (catch java.io.IOException _))))}}})

View File

@ -108,7 +108,7 @@
:output ; Output of `fmt-output-fn`, used by built-in appenders :output ; Output of `fmt-output-fn`, used by built-in appenders
; as final, formatted appender output. Appenders may (but ; as final, formatted appender output. Appenders may (but
; are not obligated to) use this as their output. ; are not obligated to) use this as their output.
:ap-config ; `shared-appender-config`. :ap-config ; Content of config's :shared-appender-config key.
:profile-stats ; From `profile` macro. :profile-stats ; From `profile` macro.
:instant ; java.util.Date. :instant ; java.util.Date.
:timestamp ; String generated from :timestamp-pattern, :timestamp-locale. :timestamp ; String generated from :timestamp-pattern, :timestamp-locale.
@ -158,14 +158,14 @@
{:standard-out {:standard-out
{:doc "Prints to *out*/*err*. Enabled by default." {:doc "Prints to *out*/*err*. Enabled by default."
:min-level nil :enabled? true :async? false :rate-limit nil :min-level nil :enabled? true :async? false :rate-limit nil
:fn (fn [{:keys [error? output]}] :fn (fn [{:keys [error? output]}] ; Use any appender args
(binding [*out* (if error? *err* *out*)] (binding [*out* (if error? *err* *out*)]
(str-println output)))} (str-println output)))}
:spit :spit
{:doc "Spits to `(:spit-filename :shared-appender-config)` file." {:doc "Spits to `(:spit-filename :shared-appender-config)` file."
:min-level nil :enabled? false :async? false :rate-limit nil :min-level nil :enabled? false :async? false :rate-limit nil
:fn (fn [{:keys [ap-config output]}] :fn (fn [{:keys [ap-config output]}] ; Use any appender args
(when-let [filename (:spit-filename ap-config)] (when-let [filename (:spit-filename ap-config)]
(try (spit filename output :append true) (try (spit filename output :append true)
(catch java.io.IOException _))))}}}) (catch java.io.IOException _))))}}})
@ -260,7 +260,8 @@
(let [{ap-config :shared-appender-config (let [{ap-config :shared-appender-config
:keys [timestamp-pattern timestamp-locale :keys [timestamp-pattern timestamp-locale
prefix-fn fmt-output-fn]} config prefix-fn fmt-output-fn]} config
timestamp-fn (make-timestamp-fn timestamp-pattern timestamp-locale)] timestamp-fn (when timestamp-pattern
(make-timestamp-fn timestamp-pattern timestamp-locale))]
(fn [juxtfn-args] (fn [juxtfn-args]
;; Runtime: ;; Runtime:
(when-let [{:keys [instant msg-type args]} juxtfn-args] (when-let [{:keys [instant msg-type args]} juxtfn-args]