The type of outputFn functions in options.output (of type Output)
The outputFn function receives:
argsToPrint: an Array of args that should be printed.
Args have already passed through l.inspect(), if options.inspect` is truthy, otherwise the args are verbatim.
The 1st item is Header, in a printable string format, if options.header.
this: the context is an object with two props:
instance: this LogZen instance calling the outputFn
logInfo: a convenience object of type IOutputLogInfo with meta log info, like "relativePath", "logLevelNum", "resolvedName" etc. Useful for JSON printing or constructing your own custom Header etc.
NOTE: Remember to NOT USE ArrowFunctions (i.e () => {}), if you need to use this context.
The type of
outputFn
functions inoptions.output
(of type Output)The
outputFn
function receives:argsToPrint
: an Array of args that should be printed.Args have already passed through
l.inspect(), if
options.inspect` is truthy, otherwise the args are verbatim.The 1st item is Header, in a printable string format, if
options.header
.this
: the context is an object with two props:instance
: this LogZen instance calling theoutputFn
logInfo
: a convenience object of typeIOutputLogInfo
with meta log info, like "relativePath", "logLevelNum", "resolvedName" etc. Useful for JSON printing or constructing your own custom Header etc.NOTE: Remember to NOT USE ArrowFunctions (i.e
() => {}
), if you need to usethis
context.