Skip to main content

Class: Logger

logger.Logger

Constructors

constructor

โ€ข new Logger()

Properties

errorColor

โ–ช Static errorColor: string = "#dc3545"

Defined in

src/logger.ts:12


listeners

โ–ช Static listeners: LogCallback[] = []

Defined in

src/logger.ts:16


successColor

โ–ช Static successColor: string = "#28a745"

Defined in

src/logger.ts:13


warnColor

โ–ช Static warnColor: string = "#ffc107"

Defined in

src/logger.ts:14

Methods

addListener

โ–ธ Static addListener(callback): void

Adds a callback which will be called whenever a message is logged.

Parameters

NameTypeDescription
callbackLogCallbackThe listener's callback

Returns

void

Defined in

src/logger.ts:77


callListeners

โ–ธ Static Private callListeners(type, str, id, args): void

Parameters

NameType
typeLogType
strstring
idstring
argsLoggerArg[]

Returns

void

Defined in

src/logger.ts:66


error

โ–ธ Static error(id, ...args): string

Parameters

NameType
idstring
...argsLoggerArg[]

Returns

string

Defined in

src/logger.ts:32


log

โ–ธ Static log(id, ...args): string

Logs a message.

Parameters

NameTypeDescription
idstringThe identifier of who is logging
...argsLoggerArg[]The args to log

Returns

string

Defined in

src/logger.ts:24


removeListener

โ–ธ Static removeListener(callback): void

Removes a listener from the logger.

Parameters

NameTypeDescription
callbackLogCallbackThe listener to remove

Returns

void

Defined in

src/logger.ts:86


str

โ–ธ Static str(id, ...args): string

Constructs the string to be logged.

Parameters

NameTypeDescription
idstringThe identifier of who is logging
...argsLoggerArg[]The args to log

Returns

string

Defined in

src/logger.ts:54


warn

โ–ธ Static warn(id, ...args): string

Parameters

NameType
idstring
...argsLoggerArg[]

Returns

string

Defined in

src/logger.ts:40