Liking cljdoc? Tell your friends :D

net.lewisship.trace

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>`.
raw docstring

*compile-trace*clj

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).
sourceraw docstring

*enable-trace*clj

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.
sourceraw docstring

set-compile-trace!clj

(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.
sourceraw docstring

set-enable-trace!clj

(set-enable-trace! value)

Sets the default value of the *enable-trace* var.

Changes take effect immediately.

When this global flag is true, tracing is enabled for all namespaces. When this flag is false, tracing is only enabled for namespaces specifically enabled via set-ns-override!.

Sets the default value of the `*enable-trace*` var.

Changes take effect immediately.

When this global flag is true, tracing is enabled for all namespaces.
When this flag is false, tracing is only enabled for namespaces specifically enabled via
[[set-ns-override!]].
sourceraw docstring

set-ns-override!clj

(set-ns-override!)
(set-ns-override! enabled?)
(set-ns-override! ns-symbol enabled?)

Enables or disables tracing for a single namespace (by default, the current namespace). The namespace must be a simple symbol. Enabling tracing for a namespace overrides the global flag managed by set-enable-trace! (tracing occurs if either the global flag is true, or the namespace is specifically enabled).

Manages a set of namespaces that are enabled in this way.

Enables or disables tracing for a single namespace (by default, the current namespace).
The namespace must be a simple symbol.  Enabling tracing for a namespace overrides the
global flag managed by [[set-enable-trace!]] (tracing occurs if either the global flag
is true, or the namespace is specifically enabled).

Manages a set of namespaces that are enabled in this way.
sourceraw docstring

setup-defaultclj

(setup-default)

Enables tracing output with a default tap of pprint.

Enables tracing output with a default tap of `pprint`.
sourceraw docstring

tracecljmacro

(trace & kvs)

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.

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.
sourceraw docstring

trace-result-readerclj

(trace-result-reader form)

A reader for the #trace/result tagged literal. When compilation is off, returns the form unchanged. When compilation is enabled, it will trace the form (as :form) and its evaluation (as :result), and evaluate to the result.

A reader for the #trace/result tagged literal.  When compilation is off,
returns the form unchanged.  When compilation is enabled, it will trace
the form (as :form) and its evaluation (as :result), and evaluate
to the result.
sourceraw docstring

trace>cljmacro

(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.
sourceraw docstring

trace>>cljmacro

(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.
sourceraw docstring

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

× close