Skip to content

Commit

Permalink
[new] Add :vargs option to log! macro to enable Telemere shim
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Sep 27, 2023
1 parent 1173427 commit 35918e1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/taoensso/timbre.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -817,18 +817,20 @@
:or {config `*config*
?err :auto}} opts

callsite-id (callsite-counter)
ns (or (:?ns-str opts) ns)
file (or (:?file opts) file)
line (or (:?line opts) line)
column (or (:?column opts) column)

callsite-id (callsite-counter)
vargs-form
(if (symbol? args)
`(enc/ensure-vec ~args)
`[ ~@args])]
(get opts :vargs ; For max flexibility
(if (symbol? args)
`(enc/ensure-vec ~args)
`[ ~@args]))]

`(-log! ~config ~level ~ns ~file ~line ~column ~msg-type ~?err
;; Note pre-resolved expansion
`(taoensso.timbre/-log! ~config ~level ~ns ~file ~line ~column ~msg-type ~?err
(delay ~vargs-form) ~?base-data ~callsite-id ~spying?))))))

(comment
Expand Down

0 comments on commit 35918e1

Please sign in to comment.