A hierarchical context, with callbacks on entry and exit of a context. The context is a map, with implementation scopes. Options can be used to modify the behaviour of the context, as a form of middleware.
:on-enter - the return value is merged into the context :on-exit - the return value is ignored
A hierarchical context, with callbacks on entry and exit of a context. The context is a map, with implementation scopes. Options can be used to modify the behaviour of the context, as a form of middleware. :on-enter - the return value is merged into the context :on-exit - the return value is ignored
Thread specific current context
Thread specific current context
The keys that control the behaviour of a context.
The keys that control the behaviour of a context.
(context-entries context)Return the context entries for a context
Return the context entries for a context
(context-history {:keys [history-kw limit] :or {history-kw :history limit 100}})(current-context)Return the current context.
Return the current context.
(formatted-context)(formatted-context context)Return the last formatted context entry for a context
Return the last formatted context entry for a context
(formatted-context-entries)(formatted-context-entries context)Return the formatted context entries for a context
Return the formatted context entries for a context
(formatted-scope-entries)(formatted-scope-entries context scope)Return the formatted context entries for the given scope
Return the formatted context entries for the given scope
(in-context entry options & body)Create a scope by pushing a context entry onto the context. On exit of the body, the context is popped.
Recognised options are: scope on-enter on-exit on-exception format
Create a scope by pushing a context entry onto the context. On exit of the body, the context is popped. Recognised options are: scope on-enter on-exit on-exception format
(log-context options)Execute body, logging the current context.
Execute body, logging the current context.
(make-context &
              {:keys [scope on-enter on-exit on-exception format]
               :or {scope :pallet.common.context/default}
               :as options})Returns a new context. Accepts optional callbacks for :on-enter and on-exit, which are called for every change in context.
Returns a new context. Accepts optional callbacks for :on-enter and on-exit, which are called for every change in context.
The keys that control the behaviour of a context.
The keys that control the behaviour of a context.
(options context
         {:keys [scope on-enter on-exit on-exception format] :as options})Set the options for a context. Accepts :on-enter and :on-exit callback functions.
Set the options for a context. Accepts :on-enter and :on-exit callback functions.
The keys that control the behaviour of a context.
The keys that control the behaviour of a context.
(scope-context-entries scope)(scope-context-entries context scope)Return a sequence of context entries for the specified scope
Return a sequence of context entries for the specified scope
(scope-formatted-context-entries scope)(scope-formatted-context-entries context scope)Return a sequence of formatted context entries for the specified scope
Return a sequence of formatted context entries for the specified scope
(throw-map msg {:as exception-map})Throws a map, containing the current context on the :context scope
Throws a map, containing the current context on the :context scope
(try-context options & body)Execute body, wrapping any exceptions in an exception which includes the current context.
Execute body, wrapping any exceptions in an exception which includes the current context.
(update-context-scope context scope)Set the context scope for entries in a context.
Set the context scope for entries in a context.
(with-context entry options & body)Wraps the body with a context, and re-throws wrapped exceptions
Wraps the body with a context, and re-throws wrapped exceptions
(with-context-history {:keys [history-kw limit] :as options} & body)Add context to a limited history
Add context to a limited history
(with-context-logging & body)Log context entries and exits
Log context entries and exits
(with-logged-context entry options & body)Wraps the body with a context, and re-throws wrapped exceptions
Wraps the body with a context, and re-throws wrapped exceptions
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs | 
| ← | Move to previous article | 
| → | Move to next article | 
| Ctrl+/ | Jump to the search field |