Constructor
new LoggerModule()
- Source:
Extends
Members
config :Object
- Description:
- Module configuration options
- Source:
Module configuration options
Type:
levelsConfig :Array
- Description:
- Defines what messages are logged
- Source:
Defines what messages are logged
Type:
logHook :Hook
- Description:
- Hook invoked on each message logged
- Source:
Hook invoked on each message logged
Type:
Methods
getModuleOverrides(level) → {Array}
- Description:
- Returns a list of log levels with overrides, either inclusive or exclusive
- Source:
Parameters:
Name |
Type |
Description |
level |
String
|
|
Returns:
-
Type
-
Array
(async) init()
- Source:
isLevelEnabled(level) → {Boolean}
- Description:
- Determines whether a specific log level is enabled
- Source:
Parameters:
Name |
Type |
Description |
level |
String
|
|
Returns:
-
Type
-
Boolean
isLoggingEnabled(level, id) → {boolean}
- Description:
- Returns whether a message should be logged (i.e. not disabled in the config)
- Source:
Parameters:
Name |
Type |
Description |
level |
string
|
Logging level |
id |
string
|
Id of log caller |
Returns:
-
Type
-
boolean
log(level, id, …args)
- Description:
- Logs a message to the console
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
level |
String
|
|
Severity of the message |
id |
String
|
|
Identifier for the message. Helps to differentiate between other messages. |
args |
*
|
<repeatable>
|
Arguments to be logged |
(static) colourise(str, colour) → {String}
- Description:
- Source:
Parameters:
Name |
Type |
Description |
str |
String
|
|
colour |
String
|
|
Returns:
-
Type
-
String
(static) getDateStamp(config) → {String}
- Description:
- Returns a formatted date stamp
- Source:
Parameters:
Name |
Type |
Description |
config |
Object
|
|
Returns:
-
Type
-
String