Concepts
Context
A context encapsulates a piece of information at a specific point in time. It can be anything from the current working directory (CwdContext
) to the output of a command (CommandContext
). Contexts are used to capture the state of the environment in which a command/function is executed.
See the Contexts section for the list of all the built-in contexts.
Watcher
A watcher encapsulates a piece of information by monitoring the execution of a command/function. It can be used to detect uncaught exceptions (UncaughtExceptionWatcher
) or measure the execution time (TimeWatcher
). Watchers are used to monitor the execution of a command/function.
See the Watchers section for more information.
Encapsulator and Capsule
You register multiple contexts and/or watchers to an encapsulator. Then, the encapsulator encapsulates the information encapsulated by the contexts and/or watchers into a "capsule".
Reporter
A reporter reports the capsule in a specific format. For example, the JsonDumpReporter
reports the capsule in JSON format.
See the Reporters section for more information.
Run
A run is a single execution of a command/function. It has three encapsulators: pre-run, in-run, and post-run.
Encapsulator | When to encapsulate | Allowed registrations |
---|---|---|
Pre-run encapsulator | Before the execution of the command/function. | Contexts |
In-run encapsulator | During the execution of the command/function. | Watchers |
Post-run encapsulator | After the execution of the command/function. | Contexts |
For each run, a run directory is created in the vault
directory. This directory is used to store the files generated by contexts, watchers, and reporters.