Skip to main content

Interface: Logger

Interface for objects where objects in this package's logs can be sent (can be used as logger option).

Methods

debug()

debug(...msg): void

Output debug message

Parameters

• ...msg: any[]

any data to log

Returns

void

Defined in

index.ts:20


error()

error(...msg): void

Output error message

Parameters

• ...msg: any[]

any data to log

Returns

void

Defined in

index.ts:41


getLevel()

getLevel(): LogLevel

Return the current LogLevel.

Returns

LogLevel

Defined in

index.ts:53


info()

info(...msg): void

Output info message

Parameters

• ...msg: any[]

any data to log

Returns

void

Defined in

index.ts:27


setLevel()

setLevel(level): void

This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") or log.error("something") will output messages, but log.info("something") will not.

Parameters

level: LogLevel

as a string, like 'error' (case-insensitive)

Returns

void

Defined in

index.ts:48


setName()

setName(name): void

This allows the instance to be named so that they can easily be filtered when many loggers are sending output to the same destination.

Parameters

name: string

as a string, will be output with every log after the level

Returns

void

Defined in

index.ts:60


warn()

warn(...msg): void

Output warn message

Parameters

• ...msg: any[]

any data to log

Returns

void

Defined in

index.ts:34