new GeneratorLogger()
Logs the start of a generator and returns an object for logging the progress, end, and error of it
- Source:
Methods
(static) begin(logger, beginMessage, endMessageopt, errorMessageopt) → {Object}
Similar to TaskLogger.execute() but is intended for generators. It creates one 'begin' log entry with:
- tag: 'begin'
- message: beginMessage
- taskId: a newly created taskId and it returns an object with logging-related methods
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
logger |
Object
|
||
beginMessage |
*
|
An initial message to log |
|
endMessage |
*
|
<optional> |
A message to be logged via end() |
errorMessage |
*
|
<optional> |
A message to be logged via error() |
Returns:
- Type:
-
Object
Returns an object with the following properties:
- {Object} logger: A child logger of 'logger' with the taskId tag
- {String} taskId and the following methods:
- error({Error} error) Log the provided error with the tag 'error'
- end({*} message) Logs endMessage and message with: a) tag: 'end' b) taskId