Skip to main content

Sparkles Log Methods

Common log methods available on the logger instance, such as fatal(), error(), warn(), info(), etc.

logry(options?: BoundLogMethod): void

Example​

const logger = logry();

logger.error(
"An error msg.",
{ userId: "123" },
{
scope: "payment",
context: { orderId: "321" },
normalizerConfig: { node: { scope: { separator: ":" } } },
formatterConfig: { node: { context: { format: "compact" } } },
},
);

Parameters​

ParameterTypeDescription
messageRawMessageThe main log message
metaRawMetaAdditional metadata
optionsLogRuntimeOptionsRuntime options for this log call

LogRuntimeOptions​

ParameterTypeDescription
scope?RawScope | stringScope(s) to categorize or filter logs
context?RawContextAdditional contextual information
normalizerConfig?NormalizerConfigConfiguration for normalizer
formatterConfig?FormatterConfigConfiguration for formatter