Macros to condition logging on the operative log level
Macros to condition logging on the operative log level
(apply-log-fn-at-level default log-fn level entry-type & args)
Returns value of log-fn
on entry-type
and args
as appropriate for level
, else return default
log-fn
is log! or value-log!, to be called only if appropriate for level.entry-type
is a keyword naming a type of entryargs
:= [<p> <o>, ...] for log!, [[<p> <o>, ...] <value>] for log-value!
These will only be evaluated if <level> is appropriatelevel
is the level of logging for the log statement, this may be overridden
by the level asserted for <entry-type>default
should be the value of <log-fn> if it's log-value!, typically nil
for log!VOCABULARY:
:glog/LogGraph
- names @log-graph in @log-graph:glog/OFF
- names the logging level that switches logging off:glog/level
<logging level>Returns value of `log-fn` on `entry-type` and `args` as appropriate for `level`, else return `default` - Where - `log-fn` is log! or value-log!, to be called only if appropriate for level. - `entry-type` is a keyword naming a type of entry - `args` := [<p> <o>, ...] for log!, [[<p> <o>, ...] <value>] for log-value! These will only be evaluated if <level> is appropriate - `level` is the level of logging for the log statement, this may be overridden by the level asserted for <entry-type> - `default` should be the value of <log-fn> if it's log-value!, typically nil for log! VOCABULARY: - `:glog/LogGraph` - names @log-graph in @log-graph - `:glog/OFF` - names the logging level that switches logging off - <log graph or entry> `:glog/level` <logging level>
(apply-std-logging-fn-at-level val level & args)
Expands to an expression that checks level
logging configuration, and prints a message to standard logging as appropriate. :glog/message
statements will be posted to standard logging regardless of whether the is a @log-graph
or not.
Where
val
is the value to be logged (or nil if we're not tracing the value of a formlevel
is a :glog/Level
args
are glog logging args appropriate to glog/std-logging-message
Expands to an expression that checks `level` logging configuration, and prints a message to standard logging as appropriate. `:glog/message` statements will be posted to standard logging regardless of whether the is a @`log-graph` or not. Where - `val` is the value to be logged (or nil if we're not tracing the value of a form - `level` is a `:glog/Level` - `args` are glog logging args appropriate to `glog/std-logging-message`
(debug entry-type & args)
Marks entry-type
as logging-level :glog/DEBUG
Marks `entry-type` as logging-level :glog/DEBUG
(error entry-type & args)
Marks entry-type
as logging-level :glog/ERROR
Marks `entry-type` as logging-level :glog/ERROR
(fatal entry-type & args)
Marks entry-type
as logging-level :glog/FATAL
Marks `entry-type` as logging-level :glog/FATAL
(info entry-type & args)
Marks entry-type
as logging-level :glog/INFO
Marks `entry-type` as logging-level :glog/INFO
(trace entry-type & args)
Marks entry-type
as logging-level :glog/TRACE
Marks `entry-type` as logging-level :glog/TRACE
(value-debug entry-type val)
(value-debug entry-type extras val)
Logs value of a form with logging level :glog/DEBUG
Logs value of a form with logging level :glog/DEBUG
(value-error entry-type val)
(value-error entry-type extras val)
Logs value of a form with logging level :glog/ERROR
Logs value of a form with logging level :glog/ERROR
(value-fatal entry-type val)
(value-fatal entry-type extras val)
Logs value of a form with logging level :glog/FATAL
Logs value of a form with logging level :glog/FATAL
(value-info entry-type val)
(value-info entry-type extras val)
Logs value of a form with logging level :glog/INFO
Logs value of a form with logging level :glog/INFO
(value-trace entry-type val)
(value-trace entry-type extras val)
Logs value of a form with logging level :glog/TRACE
Logs value of a form with logging level :glog/TRACE
(value-warn entry-type val)
(value-warn entry-type extras val)
Logs value of a form with logging level :glog/WARN
Logs value of a form with logging level :glog/WARN
(warn entry-type & args)
Marks entry-type
as logging-level :glog/WARN
Marks `entry-type` as logging-level :glog/WARN
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close