Dynamic var bound to the current session. Don't use this directly, call (current-session) instead.
Dynamic var bound to the current session. Don't use this directly, call (current-session) instead.
(completed? key)
(completed? session key)
Returns true if the log entry for the specified key has been completed. If session is omitted, the log entry in the current session will be checked.
Returns true if the log entry for the specified key has been completed. If session is omitted, the log entry in the current session will be checked.
(current-session)
Returns the current session.
Returns the current session.
(dump key)
(dump key xform)
(dump session key xform)
Saves a local environment map to the log entry corresponding to the specified key. If a transducer xform is specified, it will be applied when adding the environment map to the log entry. Defaults to clojure.core/identity. If session is specified, the environment map will be added to the log entry in that session. Otherwise, the environment map will be added to the log entry in the current session.
Saves a local environment map to the log entry corresponding to the specified key. If a transducer xform is specified, it will be applied when adding the environment map to the log entry. Defaults to clojure.core/identity. If session is specified, the environment map will be added to the log entry in that session. Otherwise, the environment map will be added to the log entry in the current session.
(frequencies)
(frequencies session)
Alias for stats
. See the docstring for stats
for details.
Alias for `stats`. See the docstring for `stats` for details.
(indexed session)
(indexed session f)
Creates an indexed session based on the given session.
An indexed session manages an auto-incremental index and attaches it to each
log item. How the session attaches the index can be specified by a function f
passed as an optional argument. The function takes two arguments, the index
and the log item, and returns a new log item. The default function is
(fn [id item] {:id id :val item})
.
Creates an indexed session based on the given session. An indexed session manages an auto-incremental index and attaches it to each log item. How the session attaches the index can be specified by a function f passed as an optional argument. The function takes two arguments, the index and the log item, and returns a new log item. The default function is `(fn [id item] {:id id :val item})`.
(keys)
(keys session)
Returns all the log entry keys that the session contains. If session is omitted, the keys will be pulled from the current session.
Returns all the log entry keys that the session contains. If session is omitted, the keys will be pulled from the current session.
(last-log-for key)
(last-log-for session key)
Completes log entry for the specified key and returns the last item in the entry. If session is omitted, the log will be pulled from the current session.
Completes log entry for the specified key and returns the last item in the entry. If session is omitted, the log will be pulled from the current session.
(locals & names)
Creates and returns a local environment map at the call site. A local environment map is a map of keyword representing each local name in the scope at that position, to the value that the local name is bound to.
Creates and returns a local environment map at the call site. A local environment map is a map of keyword representing each local name in the scope at that position, to the value that the local name is bound to.
(log-for key)
(log-for session key)
Completes log entry for the specified key and returns a vector of logged items in the entry. If session is omitted, the log will be pulled from the current session.
Completes log entry for the specified key and returns a vector of logged items in the entry. If session is omitted, the log will be pulled from the current session.
(logs)
(logs session)
Completes all log entries and returns a map of key to vector of logged items. If session is omitted, the logs will be pulled from the current session.
Completes all log entries and returns a map of key to vector of logged items. If session is omitted, the logs will be pulled from the current session.
(logs-for keys)
(logs-for session keys)
Completes log entries for the specified keys and returns a map of key to vector of logged items. If session is omitted, the logs will be pulled from the current session.
Completes log entries for the specified keys and returns a map of key to vector of logged items. If session is omitted, the logs will be pulled from the current session.
(make-indexed-session)
(make-indexed-session f)
Creates and returns a new indexed session.
Equivalent to (indexed (make-session))
or (indexed (make-session) f)
.
See the docstring for indexed
for details.
Creates and returns a new indexed session. Equivalent to `(indexed (make-session))` or `(indexed (make-session) f)`. See the docstring for `indexed` for details.
(make-logger)
(make-logger xform)
Creates a simple logger.
A simple logger is a function with two arities that closes over
an implicit session. If called with one argument, it acts like
(spy>> :key <arg>)
on the implicit session. If called with
no argument, it acts like (log-for :key)
.
If a transducer is passed as the optional argument, it will be attached to the implicit session.
Creates a simple logger. A simple logger is a function with two arities that closes over an implicit session. If called with one argument, it acts like `(spy>> :key <arg>)` on the implicit session. If called with no argument, it acts like `(log-for :key)`. If a transducer is passed as the optional argument, it will be attached to the implicit session.
(make-multi-logger)
(make-multi-logger xform)
Creates a multi logger.
A multi logger is a variant of the simple logger. If called with
two arguments, it acts like (spy>> <arg1> <arg2>)
on the implicit
session. If called with one argument, it acts like (log-for <arg>). If called with no argument, it acts like
(logs)`.
If a transducer is passed as the optional argument, it will be attached to the implicit session.
Creates a multi logger. A multi logger is a variant of the simple logger. If called with two arguments, it acts like `(spy>> <arg1> <arg2>)` on the implicit session. If called with one argument, it acts like (log-for <arg>)`. If called with no argument, it acts like `(logs)`. If a transducer is passed as the optional argument, it will be attached to the implicit session.
(make-session)
(make-session xform)
Creates and returns a new session. Sessions created by this function are thread-safe and so all updates to them will be synchronized. Only if it is guaranteed that no more than one updates never happen simultaneously, make-unsafe-session can be used instead for better performance. In ClojureScript, make-session is exactly the same as make-unsafe-session.
Creates and returns a new session. Sessions created by this function are thread-safe and so all updates to them will be synchronized. Only if it is guaranteed that no more than one updates never happen simultaneously, make-unsafe-session can be used instead for better performance. In ClojureScript, make-session is exactly the same as make-unsafe-session.
(make-unsafe-session)
(make-unsafe-session xform)
Creates and returns a new thread-unsafe session. Updates to a thread-unsafe session won't be synchronized among multithreads. If all updates to a session need to be synchronized, use make-session instead. In ClojureScript, make-unsafe-session is exactly the same as make-session.
Creates and returns a new thread-unsafe session. Updates to a thread-unsafe session won't be synchronized among multithreads. If all updates to a session need to be synchronized, use make-session instead. In ClojureScript, make-unsafe-session is exactly the same as make-session.
(merged-logs)
(merged-logs f)
(merged-logs session f)
Merges all the log entries into a single vector.
This function optionally takes a function as an argument to specify how to
handle each log entry key. The function must take the log entry key and
the log item, and return a new log item. The default function is
(fn [key item] item)
.
Merges all the log entries into a single vector. This function optionally takes a function as an argument to specify how to handle each log entry key. The function must take the log entry key and the log item, and return a new log item. The default function is `(fn [key item] item)`.
(reset!)
(reset! session)
Resets all the log entries. If session is omitted, the entries in the current session will be reset.
Resets all the log entries. If session is omitted, the entries in the current session will be reset.
(reset-key! key)
(reset-key! session key)
Resets log entry for the specified key. If session is omitted, the entries in the current session will be reset.
Resets log entry for the specified key. If session is omitted, the entries in the current session will be reset.
(reset-keys! keys)
(reset-keys! session keys)
Resets log entries for the specified keys. If session is omitted, the entries in the current session will be reset.
Resets log entries for the specified keys. If session is omitted, the entries in the current session will be reset.
(session? x)
Returns true if x is a session.
Returns true if x is a session.
(set-current-session! session)
Sets the current session to the specified one.
Sets the current session to the specified one.
(spy> x key)
(spy> x key xform)
(spy> x session key xform)
Saves a value to the log entry corresponding to the specified key and returns the value as-is. If a transducer xform is specified, it will be applied when adding the value to the log entry. Defaults to clojure.core/identity. If session is specified, the value will be added to the log entry in that session. Otherwise, the value will be added to the log entry in the current session. spy> is intended to be used in combination with thread-first macros. In thread-last contexts, use spy>> instead.
Saves a value to the log entry corresponding to the specified key and returns the value as-is. If a transducer xform is specified, it will be applied when adding the value to the log entry. Defaults to clojure.core/identity. If session is specified, the value will be added to the log entry in that session. Otherwise, the value will be added to the log entry in the current session. spy> is intended to be used in combination with thread-first macros. In thread-last contexts, use spy>> instead.
(spy>> key x)
(spy>> key xform x)
(spy>> session key xform x)
A version of spy> intended to be used in combination with thread-last macros. See the docstring of spy> for more details.
A version of spy> intended to be used in combination with thread-last macros. See the docstring of spy> for more details.
(stats)
(stats session)
Returns a stats map, which is a map of log entry key to a number that indicates how many log items have been logged for the log entry. If session is omitted, stats for the current session will be returned.
Returns a stats map, which is a map of log entry key to a number that indicates how many log items have been logged for the log entry. If session is omitted, stats for the current session will be returned.
(void-session)
Returns a void session, which logs nothing and never triggers a call to transducer. It's useful to disable logging entirely.
Returns a void session, which logs nothing and never triggers a call to transducer. It's useful to disable logging entirely.
(with-session session & body)
Dynamically binds the current session to the specified one within the body of this form.
Dynamically binds the current session to the specified one within the body of this form.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close