Liking cljdoc? Tell your friends :D

replikativ.logging

Unified structured logging for replikativ projects using trove facade.

All log calls require a namespaced keyword ID for structured filtering.

Provides level macros (trace, debug, info, warn, error), a raise macro for logging + throwing, and timing utilities.

Usage: (require '[replikativ.logging :as log])

;; message only (for backwards compatibility) (log/info "Using config")

;; ID + message (log/info :datahike/connector "Using config")

;; ID + message + data (log/info :datahike/connector "Using config" {:config c})

;; ID + data only (log/info :datahike/connector {:config c})

;; Error logging + throw (log/raise "Invalid input" {:type :validation-error :input x})

;; Timing (log/with-timing :info :component/op "msg" (body))

Unified structured logging for replikativ projects using trove facade.

All log calls require a namespaced keyword ID for structured filtering.

Provides level macros (trace, debug, info, warn, error), a raise macro
for logging + throwing, and timing utilities.

Usage:
  (require '[replikativ.logging :as log])

  ;; message only (for backwards compatibility)
  (log/info "Using config")

  ;; ID + message
  (log/info :datahike/connector "Using config")

  ;; ID + message + data
  (log/info :datahike/connector "Using config" {:config c})

  ;; ID + data only
  (log/info :datahike/connector {:config c})

  ;; Error logging + throw
  (log/raise "Invalid input" {:type :validation-error :input x})

  ;; Timing
  (log/with-timing :info :component/op "msg" (body))
raw docstring

debugclj/smacro

(debug msg)
(debug id msg-or-data)
(debug id msg data)

debug-timingclj/smacro

(debug-timing id msg & body)

Execute body and log duration at DEBUG level.

Execute body and log duration at DEBUG level.
raw docstring

errorclj/smacro

(error msg)
(error id msg-or-data)
(error id msg data)

infoclj/smacro

(info msg)
(info id msg-or-data)
(info id msg data)

info-timingclj/smacro

(info-timing id msg & body)

Execute body and log duration at INFO level.

Execute body and log duration at INFO level.
raw docstring

raiseclj/smacro

(raise & fragments)

Logging an error and throwing an exception with message and structured data. Arguments:

  • Any number of strings that describe the error
  • Last argument is a map of data that helps understanding the source of the error
Logging an error and throwing an exception with message and structured data.
Arguments:
- Any number of strings that describe the error
- Last argument is a map of data that helps understanding the source of the error
raw docstring

traceclj/smacro

(trace msg)
(trace id msg-or-data)
(trace id msg data)

warnclj/smacro

(warn msg)
(warn id msg-or-data)
(warn id msg data)

with-timingclj/smacro

(with-timing level id msg & body)

Execute body and log duration at specified level. Returns the result of body.

Execute body and log duration at specified level. Returns the result of body.
raw 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