Liking cljdoc? Tell your friends :D

mokujin.log


->strclj

(->str val)

current-contextclj

(current-context)

Returns the current context map, useful if you want to pass it to another process to continue logging with the same context. Note that due to how MDC works, this will only return the context map for the current thread and map keys will be strings, not keywords.

Returns the current context map, useful if you want to pass it to another process to continue logging with the same context.
Note that due to how MDC works, this will only return the context map for
the current thread and map keys will be strings, not keywords.
raw docstring

debugcljmacro

(debug msg)
(debug ctx msg)

Debug log, pass message or ctx+message

Debug log, pass message or ctx+message
raw docstring

debugfcljmacro

(debugf & args)

errorcljmacro

(error msg)
(error exc msg)
(error ctx exc msg)

Log an error message. [msg] [exc msg] [ctx exc msg] Context map can only be provided when passing exception AND message, otherwise, wrap your call in with-context

Log an error message.
[msg]
[exc msg]
[ctx exc msg]
Context map can only be provided when passing exception AND message,
otherwise, wrap your call in with-context
raw docstring

errorfcljmacro

(errorf & args)

format-contextclj

(format-context ctx)

infocljmacro

(info msg)
(info ctx msg)

Log an info pass message or ctx+messag

Log an info pass message or ctx+messag
raw docstring

infofcljmacro

(infof & args)

mdc-putclj

(mdc-put ctx)

timerclj

(timer)

When invoked captures current timestamp in ms, and returns a function that when invoked returns the time in ms since the original invocation.

This is useful if you want to instrument a function and return the time it took to run it and inject that into the MDC yourself.

Example:

(log/with-context {:operation "do-something"}
  (let [get-run-time-ms (log/timer)
        result (do-something)]
    (log/info {:run-time-ms (get-run-time-ms)} "do-something completed")
    result))
When invoked captures current timestamp in ms, and returns a function
that when invoked returns the time in ms since the original invocation.

This is useful if you want to instrument a function and return the time
it took to run it and inject that into the MDC yourself.

Example:

```clojure
(log/with-context {:operation "do-something"}
  (let [get-run-time-ms (log/timer)
        result (do-something)]
    (log/info {:run-time-ms (get-run-time-ms)} "do-something completed")
    result))
```
raw docstring

warncljmacro

(warn msg)
(warn ctx msg)

Log a warning pass message or ctx+message

Log a warning pass message or ctx+message
raw docstring

warnfcljmacro

(warnf & args)

with-contextcljmacro

(with-context ctx & body)

Set context map for the form. The context map should use unqualified keywords or strings for keys. Values will be stringified.

Set  context map for the form. The context map should use unqualified keywords or strings for keys.
Values will be stringified.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close