From a6942de95e1e030fc292d01b285f588213ef3445 Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Fri, 7 Jun 2019 07:50:59 +0200 Subject: [PATCH] Make calls to logging functions create deterministic code --- project.clj | 2 +- src/taoensso/timbre.cljx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/project.clj b/project.clj index b70514a..8803ce4 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject com.taoensso/timbre "4.10.0" +(defproject status-im/timbre "4.10.0-2-status" :author "Peter Taoussanis " :description "Pure Clojure/Script logging library" :url "https://github.com/ptaoussanis/timbre" diff --git a/src/taoensso/timbre.cljx b/src/taoensso/timbre.cljx index 2aab93e..bd02074 100644 --- a/src/taoensso/timbre.cljx +++ b/src/taoensso/timbre.cljx @@ -535,14 +535,19 @@ ;; NB waiting on CLJ-865: ?line (fline &form)}} opts - ?file (when (not= ?file "NO_SOURCE_PATH") ?file) + ?file (when-not (or (= ?file "NO_SOURCE_PATH") + (-> ?file + (str/split #"/") + last + (.startsWith "form-init"))) + ?file) ;; Identifies this particular macro expansion; note that this'll ;; be fixed for any fns wrapping `log!` (notably `tools.logging`, ;; `slf4j-timbre`, etc.): callsite-id (hash [level msg-type args ; Unevaluated args (arg forms) - ?ns-str ?file ?line (rand)])] + ?ns-str ?file ?line])] `(-log! ~config ~level ~?ns-str ~?file ~?line ~msg-type ~?err (delay [~@args]) ~?base-data ~callsite-id)))))