From 35918e1d35f39c36508646ae82064264fdc3ba49 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Mon, 18 Sep 2023 10:26:30 +0200 Subject: [PATCH] [new] Add `:vargs` option to `log!` macro to enable Telemere shim --- src/taoensso/timbre.cljc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/taoensso/timbre.cljc b/src/taoensso/timbre.cljc index 8ba9e168..7f465809 100644 --- a/src/taoensso/timbre.cljc +++ b/src/taoensso/timbre.cljc @@ -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