diff --git a/README.md b/README.md index f5854ff..6f66834 100644 --- a/README.md +++ b/README.md @@ -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 ; as final, formatted appender output. Appenders may (but ; 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. :instant ; java.util.Date. :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 {:doc "Prints to *out*/*err*. Enabled by default." :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*)] (str-println output)))} :spit {:doc "Spits to `(:spit-filename :shared-appender-config)` file." :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)] (try (spit filename output :append true) (catch java.io.IOException _))))}}}) diff --git a/src/taoensso/timbre.clj b/src/taoensso/timbre.clj index e468297..3843f14 100644 --- a/src/taoensso/timbre.clj +++ b/src/taoensso/timbre.clj @@ -108,7 +108,7 @@ :output ; Output of `fmt-output-fn`, used by built-in appenders ; as final, formatted appender output. Appenders may (but ; 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. :instant ; java.util.Date. :timestamp ; String generated from :timestamp-pattern, :timestamp-locale. @@ -158,14 +158,14 @@ {:standard-out {:doc "Prints to *out*/*err*. Enabled by default." :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*)] (str-println output)))} :spit {:doc "Spits to `(:spit-filename :shared-appender-config)` file." :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)] (try (spit filename output :append true) (catch java.io.IOException _))))}}}) @@ -260,7 +260,8 @@ (let [{ap-config :shared-appender-config :keys [timestamp-pattern timestamp-locale 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] ;; Runtime: (when-let [{:keys [instant msg-type args]} juxtfn-args]