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
Name | Type | Description |
---|---|---|
callback | LogCallback | The listener's callback |
Returns
void
Defined in
src/logger.ts:77
callListeners
โธ Static
Private
callListeners(type
, str
, id
, args
): void
Parameters
Name | Type |
---|---|
type | LogType |
str | string |
id | string |
args | LoggerArg [] |
Returns
void
Defined in
src/logger.ts:66
error
โธ Static
error(id
, ...args
): string
Parameters
Name | Type |
---|---|
id | string |
...args | LoggerArg [] |
Returns
string
Defined in
src/logger.ts:32
log
โธ Static
log(id
, ...args
): string
Logs a message.
Parameters
Name | Type | Description |
---|---|---|
id | string | The identifier of who is logging |
...args | LoggerArg [] | The args to log |
Returns
string
Defined in
src/logger.ts:24
removeListener
โธ Static
removeListener(callback
): void
Removes a listener from the logger.
Parameters
Name | Type | Description |
---|---|---|
callback | LogCallback | The listener to remove |
Returns
void
Defined in
src/logger.ts:86
str
โธ Static
str(id
, ...args
): string
Constructs the string to be logged.
Parameters
Name | Type | Description |
---|---|---|
id | string | The identifier of who is logging |
...args | LoggerArg [] | The args to log |
Returns
string
Defined in
src/logger.ts:54
warn
โธ Static
warn(id
, ...args
): string
Parameters
Name | Type |
---|---|
id | string |
...args | LoggerArg [] |
Returns
string
Defined in
src/logger.ts:40