Extends
Members
(static) dependencies :Array.<string>
Class dependencies:
['app', 'db', 'log.level', 'terminal']
.
connection :Knex
The connection to use based on driver configuration.
config :object
- Source:
- Inherited From:
Driver configuration.
engine :*
- Source:
- Inherited From:
Current engine accessor.
Methods
(async) storeLog(level, message, contextopt)
Store log in database.
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) cleanPastLogs()
Clear past logs in the database, starting by the least recent ones.
Returns:
The async process promise.
- Type
- Promise
getFormattedLevel(level)
Get formatted level value.
Parameters:
Name | Type | Description |
---|---|---|
level |
number | string | The level value. |
Returns:
The formatted level value.
- Type
- number
getFormattedVersion()
Get formatted version value.
Returns:
The application version.
- Type
- string
getFormattedMessage(message)
Get formatted message value.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The original message. |
Returns:
The formatted message.
- Type
- string
getFormattedCommand()
Get formatted current command.
Returns:
The command.
- Type
- string
getFormattedContext(context)
Get formatted context by converting it into JSON.
Parameters:
Name | Type | Description |
---|---|---|
context |
* | The context. |
Returns:
The formatted context.
- Type
- string
(async) log(level, message, contextopt)
- Source:
- Overrides:
Log message with context for a given level.
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
setConfig(config)
- Source:
- Inherited From:
Set configuration for the channel.
Parameters:
Name | Type | Description |
---|---|---|
config |
object | The driver configuration. |
Returns:
The current driver instance.
setEngine(engine)
- Source:
- Inherited From:
Set current engine.
Parameters:
Name | Type | Description |
---|---|---|
engine |
* | The engine instance. |
Returns:
The current instance.