Permalink
Browse files

Fix wrong arity on logf calling log*.

  • Loading branch information...
1 parent 43cf4c6 commit 32b70771de5fd52e318abb59465c411192ee4bb5 Alexander Taggart committed Jul 6, 2011
Showing with 11 additions and 1 deletion.
  1. +1 −1 src/main/clojure/clojure/tools/logging.clj
  2. +10 −0 src/test/clojure/clojure/tools/test_logging.clj
@@ -119,7 +119,7 @@
(if (impl-enabled? logger# ~level)
(if (instance? Throwable ~x) ; type check only when enabled
(log* logger# ~level ~x (format ~@more))
- (log* logger# ~level (format ~x ~@more)))))))
+ (log* logger# ~level nil (format ~x ~@more)))))))
(defmacro enabled?
"Returns true if the specific logging level is enabled. Use of this function
@@ -189,6 +189,16 @@
"hello world"]
(peek @*entries*)))))
+(deftest logf-msg-no-optimize
+ (let [a "foo %s"
+ b "bar"]
+ (logger/logf :debug a b))
+ (is (= ["clojure.tools.test-logging"
+ :debug
+ nil
+ "foo bar"]
+ (peek @*entries*))))
+
(deftest logf-msg1
(logger/logf :debug "hello")
(is (= ["clojure.tools.test-logging"

0 comments on commit 32b7077

Please sign in to comment.