inquest.core
Functions to add monitoring to existing vars.
inquest
(inquest vars reporter)
A convenience function for monitoring many vars with the same reporter
function. The return value is a zero-argument function that, when called,
will remove all of the monitoring added for the inquest.
See the monitor function for an explanation of the reporter function.
monitor
(monitor var key reporter)
Monitors an existing var, passing reports to a reporter function. A report
is a map consisting of at least the following keys:
:time - the system time in nanoseconds
:thread - the thread ID
:state - one of :enter, :exit or :throw
:var - the var being monitored
Additionally there may be the following optional keys:
:args - the arguments passed to the var (only in the :enter state)
:return - the return value from the var (only in the :exit state)
:exception - the thrown exception (only in the :throw state)
The key argument may be anything, and is used with the unmonitor function
to remove the reporter from the var.
unmonitor
(unmonitor var key)
Removes the reporter identified by the key from the var, setting it back to
normal.