How the successful closing box message is built for trace.info().
Templates render against the traced name, and parent. prefixes it the way
FunctionOpenMessage describes. For async targets the message uses the resolved (awaited)
result, not the Promise. For a method calculate of class Checkout returning
{ total: 59.85 }:
'fn' — calculate done (also the default when closeMessage is omitted)
A result that does not serialize — a void function's, most of all — reports the 'fn' /
'parent.fn' message of the same name form instead of a payload.
A callback receives a TraceCloseMessageContext and must return the message string.
Result is inferred from the target a trace.info() marker names; pass it explicitly on
trace.info<Args, Result>(options). A failed call closes with … failed in the name form this
option selects, and never reaches a callback.
How the successful closing box message is built for
trace.info().Templates render against the traced name, and
parent.prefixes it the way FunctionOpenMessage describes. For async targets the message uses the resolved (awaited) result, not the Promise. For a methodcalculateof classCheckoutreturning{ total: 59.85 }:'fn'—calculate done(also the default whencloseMessageis omitted)'parent.fn'—Checkout.calculate done'fn(result)'—calculate({"total":59.85}) done(JSON.stringify)'parent.fn(result)'—Checkout.calculate({"total":59.85}) doneA result that does not serialize — a
voidfunction's, most of all — reports the'fn'/'parent.fn'message of the same name form instead of a payload.A callback receives a TraceCloseMessageContext and must return the message string.
Resultis inferred from the target atrace.info()marker names; pass it explicitly ontrace.info<Args, Result>(options). A failed call closes with… failedin the name form this option selects, and never reaches a callback.