Skip to main content

@webda/workoutReadme | API


Class: MemoryLogger

Record all messages in memory

Extends

Constructors

new MemoryLogger(output, level, limit, includeAll)

new MemoryLogger(output, level, limit, includeAll): MemoryLogger

Parameters

output: WorkerOutput

level: WorkerLogLevel= "DEBUG"

limit: number= 2000

includeAll: boolean= false

Returns

MemoryLogger

Overrides

WorkerLogger.constructor

Source

src/loggers/memory.ts:21

Properties

includeAll

protected includeAll: boolean

Also store other message than logs if true

Source

src/loggers/memory.ts:15


level

level: WorkerLogLevel

Inherited from

WorkerLogger.level

Source

src/loggers/index.ts:7


limit

protected limit: number

Max number of messages kept

Source

src/loggers/memory.ts:19


listener

listener: (msg) => void

Parameters

msg: WorkerMessage

Returns

void

Inherited from

WorkerLogger.listener

Source

src/loggers/index.ts:8


messages

protected messages: WorkerMessage[] = []

Messages received

Source

src/loggers/memory.ts:11


output

output: WorkerOutput

Inherited from

WorkerLogger.output

Source

src/loggers/index.ts:9

Methods

clear()

clear(): void

Clear all messages

Returns

void

Source

src/loggers/memory.ts:68


close()

close(): void

Close the listener

Returns

void

Inherited from

WorkerLogger.close

Source

src/loggers/index.ts:29


getLogs()

getLogs(): WorkerMessage[]

Get all logs messages

Returns

WorkerMessage[]

Source

src/loggers/memory.ts:57


getMessages()

getMessages(): WorkerMessage[]

Get all messages recorded

Returns

WorkerMessage[]

Source

src/loggers/memory.ts:50


onMessage()

onMessage(msg): void

Process a WorkerOutput message

Parameters

msg: WorkerMessage

Returns

void

Overrides

WorkerLogger.onMessage

Source

src/loggers/memory.ts:27


setLogLevel()

setLogLevel(level): void

Set LogLevel

Parameters

level: WorkerLogLevel

Returns

void

Source

src/loggers/memory.ts:43