Extends
Members
(static) dependencies :Array.<string>
Class dependencies:
['app', 'file.engine', 'helper.file', 'log.level']
.
fileHelper :support.helpers.FileHelper
File helper.
config :object
- Source:
- Inherited From:
Driver configuration.
engine :*
- Source:
- Inherited From:
Current engine accessor.
Methods
getFullMessage(level, message)
Get full message to log.
Parameters:
Name | Type | Description |
---|---|---|
level |
number | The log level. |
message |
string | The message. |
Returns:
The full formatted message.
- Type
- string
getFormattedDate()
Get current formatted date.
Returns:
The formatted date.
- Type
- string
getFormattedLevel(level)
Get formatted level.
Parameters:
Name | Type | Description |
---|---|---|
level |
number | The level value. |
Returns:
The formatted level.
- Type
- string
getFormattedMessage(message)
Get formatted message with proper spacers.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The message. |
Returns:
The formatted message.
- Type
- string
getFormattedVersion()
Get formatted application version.
Returns:
The formatted application version.
- Type
- string
getLevelMaxLength()
Get maximum string length of available levels.
Returns:
The maximum length of all level in string version.
- Type
- number
getSpacer()
Get white space based on maximum level length.
Returns:
A spacer that covers the longest level string.
- Type
- string
ensureLimitIsUnderThreshold()
Ensure the configured file size limit is under the driver threshold.
This will prevent memory leak if removing segment in a too large file.
(async) adjustFile()
Adjust file content to fit under the configured size limit.
Returns:
The async process promise.
- Type
- Promise
hasLimit()
Check if configuration has specified size limit.
Returns:
Indicates if a limit was set in the driver configuration.
- Type
- boolean
(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.