GeneratorLogger

GeneratorLogger

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:

  1. tag: 'begin'
  2. message: beginMessage
  3. 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:

  1. {Object} logger: A child logger of 'logger' with the taskId tag
  2. {String} taskId and the following methods:
  3. error({Error} error) Log the provided error with the tag 'error'
  4. end({*} message) Logs endMessage and message with: a) tag: 'end' b) taskId