Properties
.DEBUG: LogLevel
.ERROR: LogLevel
.INFO: LogLevel
.LOG: LogLevel
.NONE: LogLevel
.WARN: LogLevel
Methods
(static) .instance(tag?: string) → Logger
Returns the Logger singleton instance
When given a tag parameter, a Logger proxy will be returned that automatically applies the given tag to all logging methods in lieu of them requiring a tag parameter before the log content
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
|
<optional> |
Tag for this instance proxy |
- Source:
.addTransport(transport: Transport) → void
Add a Transport
for the Logger to use for logging.
The logger will log to all provided transports
Parameters:
Name | Type | Description |
---|---|---|
transport |
|
The transport to add |
- Source:
.debug(tag: string, text: string) → Promise<void>
Log debug text to the logger transports. Will not be logged
unless the logging level is LogLevel.DEBUG
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
|
Tag to prefix the log with |
|
text |
|
<repeatable> |
String(s) to log |
- Source:
.error(tag: string, text: string) → Promise<void>
Log error text to the logger transports. Will not be logged
unless the logging level is LogLevel.ERROR
or higher
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
|
Tag to prefix the log with |
|
text |
|
<repeatable> |
String(s) to log |
- Source:
.info(tag: string, text: string) → Promise<void>
Log less important information to the logger transports. Will not
be logged unless the logging level is LogLevel.INFO
or higher
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
|
Tag to prefix the log with to identify the source of the log |
|
text |
|
<repeatable> |
String(s) to log |
- Source:
.log(tag: string, text: string) → Promise<void>
Log useful information to the Logger transports. Will not be logged
unless the log level is LogLevel.LOG
or higher
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
|
Tag to prefix the log with |
|
text |
|
<repeatable> |
String(s) to log |
- Source:
.removeBaseTransport() → void
Remove the default console logging transport. This is useful if you want to provide your own transport that uses the console.
This should be run before creating a YAMDBF Client instance if you do not want any logging to be done with the base transport before you get the chance to swap it out.
Logger.instance().removeBaseTransport();
Logger.instance().addTransport({ transport[, level] });
- Source:
.setLogLevel(level: LogLevel) → void
Set the level of output that will be logged
Parameters:
Name | Type | Description |
---|---|---|
level |
|
The level of logging to output |
- Source:
.warn(tag: string, text: string) → Promise<void>
Log warning text to the logger transports. Will not be logged
unless the logging level is LogLevel.WARN
or higher
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
|
Tag to prefix the log with |
|
text |
|
<repeatable> |
String(s) to log |
- Source: