Allow nil args to `log!` (just print without message)

This commit is contained in:
Peter Taoussanis 2016-12-18 12:31:46 +01:00
parent a38dceff3b
commit f4266ab60e
1 changed files with 3 additions and 1 deletions

View File

@ -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)))))