From 068d9bf2486893a39a83dafac88903ef41ceee91 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Thu, 12 Jul 2012 16:33:21 +0700 Subject: [PATCH] Use `defonce` instead of `def` for config. --- src/taoensso/timbre.clj | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/taoensso/timbre.clj b/src/taoensso/timbre.clj index be545d7..9cce5fd 100644 --- a/src/taoensso/timbre.clj +++ b/src/taoensso/timbre.clj @@ -21,18 +21,19 @@ [& xs] (print (str (str/join \space xs) \newline))) -(def config - "This map atom controls everything about the way Timbre operates. In - particular note the flexibility to add arbitrary appenders. +(defonce config + ^{:doc + "This map atom controls everything about the way Timbre operates. In + particular note the flexibility to add arbitrary appenders. - An appender is a map with keys: - :doc, :min-level, :enabled?, :async?, :max-message-per-msecs, :fn? + An appender is a map with keys: + :doc, :min-level, :enabled?, :async?, :max-message-per-msecs, :fn? - An appender's fn takes a single map argument with keys: - :ap-config, :level, :error?, :instant, :timestamp, :ns, :message, :more, - :profiling-stats (when applicable) + An appender's fn takes a single map argument with keys: + :ap-config, :level, :error?, :instant, :timestamp, :ns, :message, :more, + :profiling-stats (when applicable) - See source code for examples." + See source code for examples."} (atom {:current-level :debug ;;; Allow log filtering by namespace patterns (e.g. ["my-app.*"]).