From a547674bc2a419571a48c73eedbb78875be60d5b Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Mon, 2 Dec 2013 17:26:25 +0700 Subject: [PATCH] Message formatting: don't call `format` unless formatting args are provided --- CHANGELOG.md | 1 + src/taoensso/timbre.clj | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 207ee15..d8c37c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Overall quite happy with the state of Timbre as of this release. No major antici ### Fixes * [#38] Broken namespace filter (mlb-). * [unreported] Messages are now generated _after_ middleware has been applied, allowing better filtering performance and more intuitive behaviour (e.g. changes to args in middleware will now automatically percolate to message content). + * [unreported] (logf "hello %s") was throwing due to lack of formatting args. ## v2.6.3 → v2.7.1 diff --git a/src/taoensso/timbre.clj b/src/taoensso/timbre.clj index 7141eb8..ba0d1ae 100644 --- a/src/taoensso/timbre.clj +++ b/src/taoensso/timbre.clj @@ -296,7 +296,8 @@ (assoc :message (when-not (empty? args) (case msg-type - :format (apply format args) + :format (if-not (next args) (str args) + (apply format args)) :print-str (apply print-str args) :nil nil))))) juxtfn-args (assoc juxtfn-args :timestamp (timestamp-fn instant))