mirror of https://github.com/status-im/timbre.git
Allow nil args to `log!` (just print without message)
This commit is contained in:
parent
a38dceff3b
commit
f4266ab60e
|
@ -514,7 +514,7 @@
|
||||||
Supports compile-time elision when compile-time const vals
|
Supports compile-time elision when compile-time const vals
|
||||||
provided for `level` and/or `?ns-str`."
|
provided for `level` and/or `?ns-str`."
|
||||||
[level msg-type args & [opts]]
|
[level msg-type args & [opts]]
|
||||||
(have sequential? args) ; To allow -> (delay [~@args])
|
(have [:or nil? sequential?] args) ; To allow -> (delay [~@args])
|
||||||
(let [{:keys [?ns-str] :or {?ns-str (str *ns*)}} opts]
|
(let [{:keys [?ns-str] :or {?ns-str (str *ns*)}} opts]
|
||||||
;; level, ns may/not be compile-time consts:
|
;; level, ns may/not be compile-time consts:
|
||||||
(when-not (-elide? level ?ns-str)
|
(when-not (-elide? level ?ns-str)
|
||||||
|
@ -754,3 +754,5 @@
|
||||||
([ level ] `(log-env ~level "&env"))
|
([ level ] `(log-env ~level "&env"))
|
||||||
([ level name] `(log-env *config* ~level ~name))
|
([ level name] `(log-env *config* ~level ~name))
|
||||||
([config level name] `(log* ~config ~level ~name "=>" (get-env)))))
|
([config level name] `(log* ~config ~level ~name "=>" (get-env)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue