Light-weight, asynchronous logging built around clojure.core/tap>
.
Follows the same pattern as clojure.core/assert
: When tracing is not compiled,
the tracing macros should create no runtime overhead.
When tracing is compiled, a check occurs to see if tracing is enabled; only then
do the most expensive operations (e.g., identifying the function containing the
trace call) occur, as well as the call to clojure.core/tap>
.
Light-weight, asynchronous logging built around `clojure.core/tap>`. Follows the same pattern as `clojure.core/assert`: When tracing is not compiled, the tracing macros should create no runtime overhead. When tracing is compiled, a check occurs to see if tracing is enabled; only then do the most expensive operations (e.g., identifying the function containing the trace call) occur, as well as the call to `clojure.core/tap>`.
If false (the default), calls to trace
evaluate to nil (and trace>
and trace>>
simply return
the threaded value).
If false (the default), calls to `trace` evaluate to nil (and `trace>` and `trace>>` simply return the threaded value).
If false (the default is true) then compiled calls to trace
(and trace>
and trace>>
)
are a no-op.
If false (the default is true) then compiled calls to `trace` (and `trace>` and `trace>>`) are a no-op.
(set-compile-trace! value)
Sets the default value of the *compile-trace*
var.
Remember that after changing this, it may be necessary to re-load namespaces for the change to take effect.
Sets the default value of the `*compile-trace*` var. Remember that after changing this, it may be necessary to re-load namespaces for the change to take effect.
(set-enable-trace! value)
Sets the default value of the *enable-trace*
var.
Changes take effect immediately.
Sets the default value of the `*enable-trace*` var. Changes take effect immediately.
(setup-default)
Enables tracing output with a default tap of pprint
.
Enables tracing output with a default tap of `pprint`.
(trace & kvs)
Calls to trace generate a map that is passed to tap>
.
The map includes keys:
Additional keys and values may be supplied.
trace
expands to nil, if compilation is disabled.
Any invocation of trace evaluates to nil.
Calls to trace generate a map that is passed to `tap>`. The map includes keys: * :in - a symbol of the namespace and function * :line - the line number of the trace invocation (if available) * :thread - the string name of the current thread Additional keys and values may be supplied. `trace` expands to nil, if compilation is disabled. Any invocation of trace evaluates to nil.
(trace> value & kvs)
A version of trace
that works inside ->
thread expressions. Within the
trace body, %
is bound to the threaded value. When compilation is disabled,
it simply evaluates to the threaded value.
A version of `trace` that works inside `->` thread expressions. Within the trace body, `%` is bound to the threaded value. When compilation is disabled, it simply evaluates to the threaded value.
(trace>> & kvs-then-value)
A version of trace
that works inside ->>
thread expressions. Within the
trace body, %
is bound to the threaded value. When compilation is disabled,
it simply evaluates to the threaded value.
A version of `trace` that works inside `->>` thread expressions. Within the trace body, `%` is bound to the threaded value. When compilation is disabled, it simply evaluates to the threaded value.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close