Liking cljdoc? Tell your friends :D

mokujin.log


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-keyclj


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)

mdc-removeclj

(mdc-remove ctx)

not-blank?clj

(not-blank? v)

timingclj

(timing)

Returns a map of:

  • start-time-ms
  • get-run-time-ms - returns the time in ms since start-time-ms

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.

Example: (log/with-context {:operation "do-something"} (let [{:keys [_start-time-ms get-run-time-ms]} (timing) result (do-something)] (log/info {:run-time-ms (get-run-time-ms)} "do-something completed") result

Returns a map of:
- start-time-ms
- get-run-time-ms - returns the time in ms since start-time-ms

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.

Example:
(log/with-context {:operation "do-something"}
(let [{:keys [_start-time-ms get-run-time-ms]} (timing)
      result (do-something)]
  (log/info {:run-time-ms (get-run-time-ms)}
    "do-something completed")
  result
raw docstring

transform-ctxclj

(transform-ctx ctx)

valid-key?clj

(valid-key? key)

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