Extends
Members
(static) dependencies :Array.<string>
- Source:
Class dependencies:
['app', 'config', log.level']
.
Methods
(async) emergency(message, contextopt)
- Source:
Log emergency message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) alert(message, contextopt)
- Source:
Log alert message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) critical(message, contextopt)
- Source:
Log critical message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) error(message, contextopt)
- Source:
Log error message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) warning(message, contextopt)
- Source:
Log warning message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) notice(message, contextopt)
Log notice message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) info(message, contextopt)
Log info message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) debug(message, contextopt)
Log debug message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) log(level, message, contextopt)
Log message with default channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
level |
number | The log level. | |
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) logWithChannel(channel, level, message, contextopt)
Log message with the given channel by name.
Catches errors.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channel |
string | The channel to use. | |
level |
number | The log level. | |
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) unsafeLogWithChannel(channel, level, message, contextopt)
Log message with the given channel by name.
Does not catch errors.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channel |
string | The channel to use. | |
level |
number | The log level. | |
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Throws:
-
Indicates that the log channel was not found.
- Type
- TypeError
Returns:
The async process promise.
- Type
- Promise
(async) logWithDefaultChannel(level, message, contextopt)
Log with default channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
level |
number | The log level. | |
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
(async) logWithFallbackChannel(level, message, contextopt)
Log with fallback channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
level |
number | The log level. | |
message |
string | The message. | |
context |
* |
<optional> |
The context. |
Returns:
The async process promise.
- Type
- Promise
isLevelUnderThreshold(level, thresholdopt)
Check if the given level is under the given level threshold.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
level |
string | number | The level to evaluate. | ||
threshold |
string | number |
<optional> |
0
|
The threshold. |
Returns:
Indicates that the given level is under the given threshold.
- Type
- boolean
getLevelValue(level)
Get parsed level value from either the number value or the verbose string.
Parameters:
Name | Type | Description |
---|---|---|
level |
string | number | The level. |
Returns:
The level value as integer.
- Type
- number
setFallbackChannel(channel)
Set default channel.
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | The fallback channel name. |
driver(nameopt, parametersopt)
- Source:
- Inherited From:
Get loader driver by name.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string |
<optional> |
"default"
|
The driver name. |
parameters |
object |
<optional> |
{}
|
The additional parameters to inject into the driver instance. |
Returns:
The resolved driver instance.
- Type
- object
bootDriver(driver, name)
- Source:
- Inherited From:
Boot newly created driver.
Parameters:
Name | Type | Description |
---|---|---|
driver |
* | The driver instance. |
name |
string | The driver name. |
Returns:
The driver instance.
- Type
- *
addDriver(name, driver)
- Source:
- Inherited From:
Add a driver and bind it with the given name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The driver name. |
driver |
function | The driver class or factory. |
setDefaultDriver(name)
- Source:
- Inherited From:
Set given driver name as the default driver.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The driver name. |
setDriverAlias(name, alias)
- Source:
- Inherited From:
Give driver an alias name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The driver name. |
alias |
string | The driver alias. |
hasDriver(name)
- Source:
- Inherited From:
Check if driver exists.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The driver name. |
Returns:
Indicates that the driver exists.
- Type
- boolean
isDriverAlias(name)
- Source:
- Inherited From:
Check if given driver name is an alias.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The driver alias name. |
Returns:
Indicates that the alias exists.
- Type
- boolean