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
outputFnfunctions inoptions.output(of type Output)The
outputFnfunction receives:argsToPrint: an Array of args that should be printed.Args have already passed through
l.inspect(), ifoptions.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 theoutputFnlogInfo: a convenience object of typeIOutputLogInfowith 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 usethiscontext.