Skip to main content

tw5-typed / modules/utils/logger / Logger

Class: Logger

modules/utils/logger.Logger

A logger utility.

Description

日志记录实用程序。

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Logger(componentName?, options?): Logger

Parameters

NameType
componentName?string
options?Object
options.colour?string
options.enable?boolean
options.save?boolean
options.saveLimit?number

Returns

Logger

Defined in

src/modules/utils/logger.d.ts:7

Properties

alertCount

alertCount: number

The alert count of the logger.

Defined in

src/modules/utils/logger.d.ts:59


buffer

buffer: string

The buffer of the logger.

Defined in

src/modules/utils/logger.d.ts:55


colour

colour: string

The color of the logger.

Defined in

src/modules/utils/logger.d.ts:35


componentName

componentName: string

The name of the component.

Defined in

src/modules/utils/logger.d.ts:31


enable

enable: boolean

Whether the logger is enabled.

Defined in

src/modules/utils/logger.d.ts:39


save

save: boolean

Whether to save the log.

Defined in

src/modules/utils/logger.d.ts:43


saveBufferLogger

saveBufferLogger: Logger

The logger to save the buffer.

Defined in

src/modules/utils/logger.d.ts:51


saveLimit

saveLimit: number

The save limit of the logger.

Defined in

src/modules/utils/logger.d.ts:47

Methods

alert

alert(...arguments_): void

Alert a message.

Parameters

NameType
...arguments_any[]

Returns

void

Description

警报消息。

Defined in

src/modules/utils/logger.d.ts:89


clearAlerts

clearAlerts(): void

Clear outstanding alerts.

Returns

void

Description

清除未处理的警报。

Defined in

src/modules/utils/logger.d.ts:94


getBuffer

getBuffer(): string

Get the message buffer.

Returns

string

The message buffer.

Description

获取消息缓冲区。

Defined in

src/modules/utils/logger.d.ts:77


log

log(...arguments_): void

Log a message.

Parameters

NameType
...arguments_any[]

Returns

void

Description

记录消息。

Defined in

src/modules/utils/logger.d.ts:71


new

new(componentName?, options?): any

Parameters

NameType
componentName?string
options?Object
options.colour?string
options.enable?boolean
options.save?boolean
options.saveLimit?number

Returns

any

Defined in

src/modules/utils/logger.d.ts:18


setSaveBuffer

setSaveBuffer(logger): void

Set the logger to save the buffer.

Parameters

NameTypeDescription
loggerLoggerThe logger to save the buffer.

Returns

void

Description

设置记录器以保存缓冲区。

Defined in

src/modules/utils/logger.d.ts:65


table

table(value): void

Log a structure as a table.

Parameters

NameTypeDescription
valueanyThe value to log.

Returns

void

Description

将结构记录为表格。

Defined in

src/modules/utils/logger.d.ts:83