Skip to main content

Class: DefaultLogger

worker.DefaultLogger

Default worker logger - uses a default log function to log messages to console.error. See constructor arguments for customization.

Implements#

Constructors#

constructor#

new DefaultLogger(level?, logFunction?)

Parameters#

NameType
level?LogLevel
logFunction?(level: LogLevel, message: string, meta?: Record<string, any>) => void

Properties#

level#

Readonly level: LogLevel

Methods#

debug#

debug(message, meta?): void

Parameters#

NameType
messagestring
meta?Record<string, any>

Returns#

void

Implementation of#

Logger.debug


error#

error(message, meta?): void

Parameters#

NameType
messagestring
meta?Record<string, any>

Returns#

void

Implementation of#

Logger.error


info#

info(message, meta?): void

Parameters#

NameType
messagestring
meta?Record<string, any>

Returns#

void

Implementation of#

Logger.info


log#

log(level, message, meta?): void

Parameters#

NameType
levelLogLevel
messagestring
meta?Record<string, any>

Returns#

void


trace#

trace(message, meta?): void

Parameters#

NameType
messagestring
meta?Record<string, any>

Returns#

void

Implementation of#

Logger.trace


warn#

warn(message, meta?): void

Parameters#

NameType
messagestring
meta?Record<string, any>

Returns#

void

Implementation of#

Logger.warn