This file defines simple tracing macros to help you see what your code is doing.
This file defines simple tracing macros to help you see what your code is doing.
(deftrace name & definition)
Use in place of defn; traces each call/return of this fn, including arguments. Nested calls to deftrace'd functions will print a tree-like structure. The first argument of the form definition can be a doc string
Use in place of defn; traces each call/return of this fn, including arguments. Nested calls to deftrace'd functions will print a tree-like structure. The first argument of the form definition can be a doc string
(dotrace fnames & exprs)
Given a sequence of function identifiers, evaluate the body expressions in an environment in which the identifiers are bound to the traced functions. Does not work on inlined functions, such as clojure.core/+
Given a sequence of function identifiers, evaluate the body expressions in an environment in which the identifiers are bound to the traced functions. Does not work on inlined functions, such as clojure.core/+
Protocol to isolate trace-form from convoluted throwables that do not have a constructor with a single string argument.
clone-throwable attempts to clone a throwable with a human readable stack trace and message :) It must return a throwable of the same class. If not clonable, the original throwable should be returned. At least this will preserve the original throwable information.
Cloning should be non-obtrusive hence internal exceptions should be silently swallowed and return the original throwable.
Protocol to isolate trace-form from convoluted throwables that do not have a constructor with a single string argument. clone-throwable attempts to clone a throwable with a human readable stack trace and message :) It must return a throwable of the same class. If not clonable, the original throwable should be returned. At least this will preserve the original throwable information. Cloning should be non-obtrusive hence internal exceptions should be silently swallowed and return the original throwable.
(clone-throwable this stack-trace args)
(trace value)
(trace name value)
Sends name (optional) and value to the tracer function, then returns value. May be wrapped around any expression without affecting the result.
Sends name (optional) and value to the tracer function, then returns value. May be wrapped around any expression without affecting the result.
(trace-forms & body)
Trace all the forms in the given body. Returns any underlying uncaught exceptions that may make the forms fail.
Trace all the forms in the given body. Returns any underlying uncaught exceptions that may make the forms fail.
(trace-ns n)
Trace all fns in the given name space. The given name space can be quoted, unquoted or stored in a var. We must try to resolve the expression passed to us partially to find out if it needs to be quoted or not when passed to trace-ns*
Trace all fns in the given name space. The given name space can be quoted, unquoted or stored in a var. We must try to resolve the expression passed to us partially to find out if it needs to be quoted or not when passed to trace-ns*
(trace-vars & vs)
Trace each of the specified Vars. The arguments may be Var objects or symbols to be resolved in the current namespace.
Trace each of the specified Vars. The arguments may be Var objects or symbols to be resolved in the current namespace.
(traceable? v)
Returns true if the given var can be traced, false otherwise
Returns true if the given var can be traced, false otherwise
(traced? v)
Returns true if the given var is currently traced, false otherwise
Returns true if the given var is currently traced, false otherwise
(untrace-ns n)
Untrace all fns in the given name space. The given name space can be quoted, unquoted or stored in a var. We must try to resolve the expression passed to us partially to find out if it needs to be quoted or not when passed to untrace-ns*
Untrace all fns in the given name space. The given name space can be quoted, unquoted or stored in a var. We must try to resolve the expression passed to us partially to find out if it needs to be quoted or not when passed to untrace-ns*
(untrace-vars & vs)
Untrace each of the specified Vars. Reverses the effect of trace-var / trace-vars / trace-ns for each of the arguments, replacing the traced functions with the original, untraced versions.
Untrace each of the specified Vars. Reverses the effect of trace-var / trace-vars / trace-ns for each of the arguments, replacing the traced functions with the original, untraced versions.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close