Skip to main content

@webda/workoutReadme | API


Class: ConsoleLogger

ConsoleLogger

Extends

Constructors

new ConsoleLogger(output, level, format)

new ConsoleLogger(output, level?, format?): ConsoleLogger

Parameters

output: WorkerOutput

level?: WorkerLogLevel

format?: string= ConsoleLogger.defaultFormat

Returns

ConsoleLogger

Overrides

WorkerLogger.constructor

Source

src/loggers/console.ts:20

Properties

format

format: string

Source

src/loggers/console.ts:18


level

level: WorkerLogLevel

Inherited from

WorkerLogger.level

Source

src/loggers/index.ts:7


listener

listener: (msg) => void

Parameters

msg: WorkerMessage

Returns

void

Inherited from

WorkerLogger.listener

Source

src/loggers/index.ts:8


output

output: WorkerOutput

Inherited from

WorkerLogger.output

Source

src/loggers/index.ts:9


defaultFormat

static defaultFormat: string = "%(d)s [%(l)s] %(m)s"

Source

src/loggers/console.ts:17

Methods

close()

close(): void

Close the listener

Returns

void

Inherited from

WorkerLogger.close

Source

src/loggers/index.ts:29


onMessage()

onMessage(msg): void

Parameters

msg: WorkerMessage

Returns

void

Overrides

WorkerLogger.onMessage

Source

src/loggers/console.ts:28


display()

static display(msg, format): void

Display a message to the console

Parameters

msg: WorkerMessage

format: string= ConsoleLogger.defaultFormat

Returns

void

Source

src/loggers/console.ts:77


format()

static format(msg, format): string

Format a log based on format string

Parameters

msg: WorkerMessage

format: string= ConsoleLogger.defaultFormat

Returns

string

Source

src/loggers/console.ts:87


getColor()

static getColor(level): (s) => string

Parameters

level: WorkerLogLevel

to get color from

Returns

Function

Parameters

s: string

Returns

string

Source

src/loggers/console.ts:36


handleMessage()

static handleMessage(msg, level, format): void

Commonly handle a message

Parameters

msg: WorkerMessage

level: WorkerLogLevel

format: string= ConsoleLogger.defaultFormat

Returns

void

Source

src/loggers/console.ts:53