snapcap
API ReferenceType Aliases

Logger

Type Alias: Logger

type Logger = (event: LogEvent) => void;

Defined in: logging.ts:108

Handler signature passed to setLogger.

Parameters

ParameterTypeDescription
eventLogEventOne emitted LogEvent. Switch on event.kind to narrow to a specific variant.

Returns

void

Remarks

Handlers should return synchronously and avoid throwing — exceptions thrown from a handler are swallowed by the internal emit point so a bad logger can never break the network path, but they will be silently dropped.

On this page