Users have reported seeing `Wrong number of args (9) passed to: timbre/-log!`
errors via slf4j-timbre when upgrading from Timbre v4.4.0 -> v4.5.0.

slf4j-timbre already uses the correct public API (timbre/log!), so this looks
like an AOT issue: a compiled Timbre v4.4.0 `log!` macro expansion is calling
a `v4.5.0` `-log!` function and breaking.

Unfortunately, looks[1] like a user-level call to `lein clean` isn't enough to
resolve the issue. Might be that slf4j-timbre itself needs to be recompiled?

Whatever the underlying cause, this should be a reasonable workaround for now.

[1] : https://github.com/fzakaria/slf4j-timbre/issues/20#issuecomment-229254285
This commit is contained in:
Peter Taoussanis 2016-06-29 11:15:45 +07:00
parent 0a765cb9ca
commit 64dc0f52aa
1 changed files with 11 additions and 3 deletions

View File

@ -358,8 +358,16 @@
(infof ^:meta {:err (Exception. "ex")} "Hi %s" "steve"))
(defn -log! "Core low-level log fn. Implementation detail!"
[config level ?ns-str ?file ?line msg-type ?err vargs_
?base-data callsite-id]
;; TODO Temp workaround for
;; https://github.com/fzakaria/slf4j-timbre/issues/20 and similar AOT tools
([config level ?ns-str ?file ?line msg-type ?err vargs_ ?base-data]
;; (throw (ex-info "Invalid internal Timbre call. Please try run `lein clean` to clear out-of-date build artifacts." {}))
(-log! config level ?ns-str ?file ?line msg-type ?err vargs_
?base-data nil))
([config level ?ns-str ?file ?line msg-type ?err vargs_
?base-data callsite-id]
(when (log? level ?ns-str config) ; Runtime check
(let [instant (enc/now-dt)
@ -490,7 +498,7 @@
(apfn data))))))))
nil
(:appenders config))))))
nil)
nil))
(comment
(-log! *config* :info nil nil nil :p :auto