Skip to content

Commit

Permalink
Add doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszkorecki committed May 13, 2024
1 parent f7d71f6 commit 57a3ed8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mokujin/log.clj
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@
;; Re-export generic log functions but with context support
;; NOTE: these are SLOWER than dedicated log macros
(defmacro log
"Log wrapper which is helpful if you need to programatically control the log level"
([level msg]
(with-meta
`(log/log ~level ~msg)
(meta &form)))
([level msg context? & _rest]
([level msg context?]
(with-meta
`(cond
(and (string? ~msg)
Expand All @@ -145,7 +146,9 @@
(not (map? ~context?))) (log/log ~level ~msg))
(meta &form))))

(defmacro logf [level msg & args]
(defmacro logf
"Log wrapper which is helpful if you need to programatically control the log level."
[level msg & args]
(with-meta
`(log/logf ~level ~msg ~@args)
(meta &form)))
Expand Down

0 comments on commit 57a3ed8

Please sign in to comment.