Liking cljdoc? Tell your friends :D

io.randomseed.utils.log

Random utils, opinionated logging support functions.

Random utils, opinionated logging support functions.
raw docstring

*already-logged*clj

When true, indicates the current exception has already been logged and should not be logged again by outer handlers.

When `true`, indicates the current exception has already been logged and should not be logged again by outer handlers.
sourceraw docstring

dbgcljmacro

(dbg msg & more)

Logs a space-joined message at DEBUG level using some-str-spc.

Logs a space-joined message at DEBUG level using `some-str-spc`.
sourceraw docstring

debugcljmacro

(debug msg-or-throwable)
(debug mdc-or-throwable msg)
(debug mdc throwable msg)

Logs a message at DEBUG level.

Logs a message at DEBUG level.
sourceraw docstring

default-configclj

Default logging configuration map: INFO level with console output enabled.

Default logging configuration map: INFO level with console output enabled.
sourceraw docstring

errcljmacro

(err msg & more)

Logs a space-joined message at ERROR level using some-str-spc.

Logs a space-joined message at ERROR level using `some-str-spc`.
sourceraw docstring

err-with-valcljmacro

(err-with-val msg & more)

Logs msg (and optional extra parts) at ERROR level. When extra arguments are present, the last one is returned as the expression value.

Logs `msg` (and optional extra parts) at ERROR level. When extra arguments are
present, the last one is returned as the expression value.
sourceraw docstring

errorcljmacro

(error msg-or-throwable)
(error mdc-or-throwable msg)
(error mdc throwable msg)

Logs a message at ERROR level.

Logs a message at ERROR level.
sourceraw docstring

fatalcljmacro

(fatal msg-or-throwable)
(fatal mdc-or-throwable msg)
(fatal mdc throwable msg)

Logs a message at FATAL level.

Logs a message at FATAL level.
sourceraw docstring

infocljmacro

(info msg-or-throwable)
(info mdc-or-throwable msg)
(info mdc throwable msg)

Logs a message at INFO level.

Logs a message at INFO level.
sourceraw docstring

init!clj

(init! config)

Initialises the logging subsystem. Snapshots the current Logback state, detaches previously installed appenders, configures the JSON decoder and the context transformer, then starts unilog. Returns a map with :config, :previous-ctx-transformer, :previous-logback, and :unilog keys suitable for passing to stop! to restore the prior state.

Initialises the logging subsystem. Snapshots the current Logback state, detaches
previously installed appenders, configures the JSON decoder and the context
transformer, then starts unilog. Returns a map with `:config`,
`:previous-ctx-transformer`, `:previous-logback`, and `:unilog` keys suitable for
passing to `stop!` to restore the prior state.
sourceraw docstring

initialize-context-transformer!clj

(initialize-context-transformer! transform-map)

Installs a cambium context transformer derived from transform-map. Returns the previous transformer (or nil if nothing changed).

Installs a cambium context transformer derived from `transform-map`.
Returns the previous transformer (or nil if nothing changed).
sourceraw docstring

initialize-json-decoder!clj

(initialize-json-decoder!)

Configures the JSON decoder for structured logging: enables big-decimal parsing, installs the cambium destringify codec and sets the global FlatJsonLayout decoder.

Configures the JSON decoder for structured logging: enables big-decimal parsing,
installs the cambium destringify codec and sets the global `FlatJsonLayout` decoder.
sourceraw docstring

logcljmacro

(log level msg-or-throwable)
(log logger level msg-or-throwable)
(log level mdc throwable msg)
(log logger level mdc-or-throwable throwable msg)

Logs a message at the given level. Delegates to cambium.core/log.

Logs a message at the given `level`. Delegates to `cambium.core/log`.
sourceraw docstring

log-contextcljmacro

(log-context context & body)

Evaluates body with additional MDC logging context (a map).

Evaluates `body` with additional MDC logging `context` (a map).
sourceraw docstring

log-exceptionscljmacro

(log-exceptions & body)

Wraps body in a try/catch that logs any Throwable at ERROR level (with the exception stringified in the MDC context) and re-throws it with *already-logged* bound to true so outer handlers can avoid duplicate logging.

Wraps `body` in a try/catch that logs any `Throwable` at ERROR level (with the
exception stringified in the MDC context) and re-throws it with `*already-logged*`
bound to `true` so outer handlers can avoid duplicate logging.
sourceraw docstring

msgcljmacro

(msg msg & more)

Logs a space-joined message at INFO level using some-str-spc.

Logs a space-joined message at INFO level using `some-str-spc`.
sourceraw docstring

msg-with-valcljmacro

(msg-with-val msg & more)

Logs msg (and optional extra parts) at INFO level. When extra arguments are present, the last one is returned as the expression value.

Logs `msg` (and optional extra parts) at INFO level. When extra arguments are
present, the last one is returned as the expression value.
sourceraw docstring

preprocess-configclj

(preprocess-config config)

Pre-processes logging config by expanding Java property placeholders in :file paths of each appender entry. Marks the config as :preprocessed to avoid repeated processing. Returns config unchanged when no :appenders key is present or the config has already been preprocessed.

Pre-processes logging `config` by expanding Java property placeholders in `:file`
paths of each appender entry. Marks the config as `:preprocessed` to avoid
repeated processing. Returns `config` unchanged when no `:appenders` key is present
or the config has already been preprocessed.
sourceraw docstring

start!clj

(start! config)

Starts the logging subsystem by delegating to unilog/start-logging! with the given config map.

Starts the logging subsystem by delegating to `unilog/start-logging!` with the
given `config` map.
sourceraw docstring

stop!clj

(stop! {:keys [previous-ctx-transformer previous-logback]})

Tears down the logging subsystem and restores the state captured by init!. Detaches appenders prefixed with "io.randomseed.utils.log.", restores the previous context transformer and the previous Logback snapshot. Returns nil.

Tears down the logging subsystem and restores the state captured by `init!`.
Detaches appenders prefixed with `"io.randomseed.utils.log."`, restores the
previous context transformer and the previous Logback snapshot. Returns `nil`.
sourceraw docstring

tracecljmacro

(trace msg-or-throwable)
(trace mdc-or-throwable msg)
(trace mdc throwable msg)

Logs a message at TRACE level.

Logs a message at TRACE level.
sourceraw docstring

warncljmacro

(warn msg-or-throwable)
(warn mdc-or-throwable msg)
(warn mdc throwable msg)

Logs a message at WARN level.

Logs a message at WARN level.
sourceraw docstring

warningcljmacro

(warning msg-or-throwable)
(warning mdc-or-throwable msg)
(warning mdc throwable msg)

Alias for warn. Logs a message at WARN level.

Alias for `warn`. Logs a message at WARN level.
sourceraw docstring

with-ctxcljmacro

(with-ctx context & body)

Alias for log-context. Evaluates body with additional MDC logging context.

Alias for `log-context`. Evaluates `body` with additional MDC logging `context`.
sourceraw docstring

wrncljmacro

(wrn msg & more)

Logs a space-joined message at WARN level using some-str-spc.

Logs a space-joined message at WARN level using `some-str-spc`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close