Comunica
    Preparing search index...

    A bunyan-based logger implementation.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    activeLogGroups: Record<
        string,
        { callback: (count: number) => void; count: number; lastSeenIndex: number },
    > = {}
    groupedLogLimit: 5
    repetitionCounter: number = 0
    LEVELS: Record<string, number> = ...

    All available logging levels.

    Methods

    • Check if messages at the given level are emitted, so callers can skip computing their log data otherwise.

      Parameters

      • level: LogLevel

        The logging level to check.

      Returns boolean

      If messages at the given level are emitted, which is always the case by default.

    • Log a message that might be repeated, preventing console spam. If the same key is passed multiple times, only the first time the emit callback will be invoked immediately. All subsequent calls will be buffered, until at least Logger#groupedLogLimit other logGrouped calls are made, or Logger#flush is called.

      Parameters

      • key: string

        A unique key for this message (e.g. the message template).

      • emit: (count: number) => void

        A callback to emit the message.

      Returns void

    • Convert a string-based logging level to a numerical logging level.

      Parameters

      • level: string

        A string-based logging level

      Returns number

      The numerical logging level, or undefined.