Simple Clojure logging facade for logging structured data via SLF4J 2+.
Simple Clojure logging facade for logging structured data via SLF4J 2+.
Logging context. A structured alternative to the MDC that is thread safe and nicer to use from Clojure. (You can still use the MDC if you like.)
Everything in here in scope of the log statement will be included in the log. Try to use fully qualified keywords to avoid naming conflicts with the core log data.
Why an atom AND a dynamic var? The dynamic var allows this value to differentiate between threads and dynamic scope, while the atom provides safe alteration and the ability to set global context values.
Logging context. A structured alternative to the [MDC][] that is thread safe and nicer to use from Clojure. (You can still use the MDC if you like.) [MDC]: https://logback.qos.ch/manual/mdc.html Everything in here in scope of the log statement will be included in the log. Try to use fully qualified keywords to avoid naming conflicts with the core log data. --- Why an atom AND a dynamic var? The dynamic var allows this value to differentiate between threads and dynamic scope, while the atom provides safe alteration and the ability to set global context values.
(debug msg data & {:keys [cause markers logger-ns]})
Log a message (msg
) and data
at the :debug
logging level.
See com.kroo.epilogue/log
for more details.
Log a message (`msg`) and `data` at the `:debug` logging level. See `com.kroo.epilogue/log` for more details.
(defloggingmacro name doc-string? attr-map? [params*] body)
(defloggingmacro name doc-string? attr-map? ([params*] body) + attr-map?)
Defines a macro that preserves the original line number and column making it
suitable for logging. Otherwise behaves identically to defmacro
.
Defines a macro that preserves the original line number and column making it suitable for logging. Otherwise behaves identically to `defmacro`.
(error msg data & {:keys [cause markers logger-ns]})
Log a message (msg
) and data
at the :error
logging level.
See com.kroo.epilogue/log
for more details.
Log a message (`msg`) and `data` at the `:error` logging level. See `com.kroo.epilogue/log` for more details.
(info msg data & {:keys [cause markers logger-ns]})
Log a message (msg
) and data
at the :info
logging level.
See com.kroo.epilogue/log
for more details.
Log a message (`msg`) and `data` at the `:info` logging level. See `com.kroo.epilogue/log` for more details.
(log level msg data & {:keys [cause markers logger-ns]})
Logs a message (msg
) and data
at the specified logging level
. The log
will also include anything in *context*
within the current dynamic scope.
data
can be anything that implements the clojure.core.protocols/IKVReduce
protocol, but it is recommended to log only maps to avoid confusion.
Options:
cause
,markers
(or strings/keywords), andlogger-ns
).Logs a message (`msg`) and `data` at the specified logging `level`. The log will also include anything in `*context*` within the current dynamic scope. `data` can be anything that implements the `clojure.core.protocols/IKVReduce` protocol, but it is recommended to log only maps to avoid confusion. Options: - a throwable object as the `cause`, - a sequence of SLF4J `markers` (or strings/keywords), and - an override logger namespace (`logger-ns`).
(log* level msg data cause markers logger-ns src)
Primitive logging function for Epilogue.
Do not use this function directly! Use the provided macros instead. Backwards compatibility is not guaranteed for this function.
Primitive logging function for Epilogue. Do not use this function directly! Use the provided macros instead. Backwards compatibility is not guaranteed for this function.
(raise msg data & {:keys [level cause markers logger-ns]})
Log and throw. Logs at :error
level by default. Constructs and throws a
clojure.lang.ExceptionInfo
object.
Log and throw. Logs at `:error` level by default. Constructs and throws a `clojure.lang.ExceptionInfo` object.
(trace msg data & {:keys [cause markers logger-ns]})
Log a message (msg
) and data
at the :trace
logging level.
See com.kroo.epilogue/log
for more details.
Log a message (`msg`) and `data` at the `:trace` logging level. See `com.kroo.epilogue/log` for more details.
(warn msg data & {:keys [cause markers logger-ns]})
Log a message (msg
) and data
at the :warn
logging level.
See com.kroo.epilogue/log
for more details.
Log a message (`msg`) and `data` at the `:warn` logging level. See `com.kroo.epilogue/log` for more details.
(with-context context & body)
Merge context
onto the current logging *context*
, creating a new scope
around body
.
Merge `context` onto the current logging `*context*`, creating a new scope around `body`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close