Improve error message for logging calls with missing format pattern

This commit is contained in:
Peter Taoussanis 2016-12-18 11:59:12 +01:00
parent 4874458007
commit 4eb8433f8e

View File

@ -389,8 +389,18 @@
(delay
(case msg-type
nil ""
:p (str-join vargs)
:f (enc/format* (have string? ?msg-fmt) vargs)))
:p (str-join vargs)
:f #_(enc/format* (have string? ?msg-fmt) vargs)
(do
(when-not (string? ?msg-fmt)
(throw
(ex-info "Timbre format-style logging call without a format pattern (string)"
#_data
{:level level
:location (str (or ?ns-str ?file "?") ":"
(or ?line "?"))})))
(enc/format* ?msg-fmt vargs))))
;; Uniquely identifies a particular logging call for
;; rate limiting, etc.