Metadata "debug"
The debug
metadata print detailed information of an action and its children. It provides a quick and convenient solution to understand the various actions called, what they do, and in which order.
- One of
- Type:
boolean
- Type:
string
Values:stderr
orstdout
- Type: instance of
stream.Writable
- Type:
- Default:
false
When activated with the value true
, information is printed to the standard error output (stderr
).
The information generated by the debug
metadata is similar to the output of the logging facilities. So when shall debugging be used versus logging? The debug
metadata is for developers who wish to punctually see on their shell what going on inside. The logging facilities are meant to be constantly activated.
Usage
Activating debugging
Activating debugging is easy, simply pass the debug
metadata with a value set as true
:
nikita
.file.touch({
$debug: true target: '/tmp/a_file'
})
Of course, it is possible to activate debugging to the overall Nikita session by passing the metadata globally at session creation:
nikita({
$debug: true})
.file.touch({
target: '/tmp/a_file'
})
Redirecting output to stdout
Set the value to stdout
if you wish to print debugging information to the standard output (stdout):
nikita
.file.touch({
$debug: 'stdout', target: '/tmp/a_file'
})