Interface Loggable<TTarget>

A value that may be logged in a custom way.

Type Parameters

Hierarchy

  • Loggable

Methods

Methods

  • Performs additional message processing before it is logged.

    This method is called for each element of the logged message line in order. It may wish to change the logged message either by modifying it, or by returning a loggable representation of the value.

    The method call results interpreted as following:

    1. If the method replaced the log line or currently processed element, or updated the next element's index, then the returned value is ignored, and the new log line processing continues from the new element index.

    2. If the returned value is undefined or the same as this, then the log line processing continues from the next element.

    3. If the returned value is Loggable, it replaces the current element, and the log line processing continues from the same element index. This allows recurrent processing.

    4. If the returned value is an array, then current element is removed and all elements of the returned array are inserted at the same position. The log line processing continues from the same element index. This allows recurrent processing. This also makes it possible to remove the value from the log line by returning an empty array.

    Parameters

    • target: TTarget & DueLog

      Log message to process containing this loggable value at the specified index.

    Returns unknown

    Either new loggable value representation, or nothing or this value itself to not replace its loggable representation.

Generated using TypeDoc