Interface ZLogBuffer

Log buffer.

A log recorder that buffers messages and is able to drain them to another recorder.

The buffered messages are not

Hierarchy

Methods

  • Drains buffered messages to target log recorder.

    Messages are drained one at a time. The next message is recorded to target only when the previous one either logged or discarded.

    Calling this method again changes the target.

    Parameters

    • target: undefined | null | ZLogRecorder

      Target log recorder to drain buffered messages to, or null/undefined to stop draining.

    • Optional atOnce: number

      The maximum number of buffered messages to drain at once. 32 by default.

    Returns void

  • Awaits for the recorded message(s) to be either logged or discarded.

    Parameters

    • Optional which: "all" | "last"

      Which message to wait for. Either "all" to wait for all messages or "last" to wait for the last message only. The default is "last"

    Returns Promise<boolean>

    A promise resolved to true if the last recorded message is logged, or to false if it is discarded.

Generated using TypeDoc