Skip to content

Commit

Permalink
[mod] default-output-fn: omit "?" location info
Browse files Browse the repository at this point in the history
Change intended to reduce unhelpful noise in output

Before this commit:
  2024-08-30T07:34:40.806Z MyHostName INFO [my.ns:126] - My message ; Have ns, line
  2024-08-30T07:34:40.806Z MyHostName INFO [my.ns:?] - My message   ; Have ns only
  2024-08-30T07:34:40.806Z MyHostName INFO [?:?] - My message       ; Have neither

After this commit:
  2024-08-30T07:34:40.806Z MyHostName INFO [my.ns:126] - My message ; Have ns, line (unchanged)
  2024-08-30T07:34:40.806Z MyHostName INFO [my.ns] - My message     ; Have ns only  (omit "?")
  2024-08-30T07:34:40.806Z MyHostName INFO - My message             ; Have neither  (omit "[?:?]")
  • Loading branch information
ptaoussanis committed Aug 30, 2024
1 parent 73bf805 commit 6d7495a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/taoensso/timbre.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,10 @@
(when-let [ts (force timestamp_)] (str ts " "))
#?(:clj (force hostname_)) #?(:clj " ")
(str/upper-case (name level)) " "
"[" (or ?ns-str ?file "?") ":" (or ?line "?") "] - "
;; "[" (or ?ns-str ?file "?") ":" (or ?line "?") "] - "
(when-let [loc (or ?ns-str ?file)]
(str "[" loc (when-let [line ?line] (str ":" line)) "]"))
" - "

(when-let [msg-fn (get output-opts :msg-fn default-output-msg-fn)]
(msg-fn data))
Expand Down

0 comments on commit 6d7495a

Please sign in to comment.