Optionalopencontrols the opening trace message
Optionalclosecontrols the successful closing trace message
Optionalmodulethe corresponding key of a LoxerModule provided during Loxer.init()
Is a string by default. Augment the LoxerModuleRegistry (exported from loxer) to have the
accepted ids autocompleted and typo-checked against the modules of your project.
Optionallevelthe BoxLevel of the trace box. defaults to 'info'
'error' is not accepted, because a trace opens and closes a box while an error is a single
event.
Optionalnamethe name a marked function reports in its box messages
A function reached by a marker rather than by name — a literal passed to trace(), or the
function a trace(options) statement sits in — is named after itself, or after the binding,
assignment target, or property it belongs to: const load = useCallback(trace(...), []) reports
load. Supply name where nothing names it, such as
useEffect(trace(() => { ... }, { name: 'syncOrders' }), []).
Has to be a string literal, because the transform reads it while it builds. @trace() and
trace(namedFunction, options) know their target's name and ignore it.
Optionalhighlightwhich lifecycle messages should be highlighted
Optionalargsattaches the call's arguments to the opening log, one prop per argument
Optionalresultattaches a defined resolved result to the closing log, as a single prop; a void result
attaches none
Optionalprintasks the built-in output to render the opening log's props, and configures that rendering
Like TraceOptions.argsAsProps, this only concerns the arguments. Set it to true for
the default configuration, or to a PropsPrinterOptions object to bound the rendering -
{ depth: 1 } keeps a wide argument list readable.
Optionalprintasks the built-in output to render the closing log's props, and configures that rendering
The counterpart of TraceOptions.printArgs for the result.
Options shared by the
@trace()method decorator and thetrace()function marker in each of its forms.A marker that names its target —
trace(target | [targets], options)— infersArgsandResultfrom it, from the union of every listed target when it marks a list.@trace()and thetrace(options)marker inside a function have no signature in hand, so supply them explicitly when formatter callbacks need precise types.parent.functionNamenames the class a traced method belongs to — a decorated method, or a method, getter, setter, or field a marker reaches inside a class body — and otherwise the file a marked function is written in. A class name ending inClassreports without that suffix. The decorator reads its class from the running instance, and the file name comes from the build, so a decorated method that a call reaches detached from its class reports its own name alone.