Base class for values that get generated by Logger instances.

NOTE: this class should be considered read-only, and its fields should not be mutated directly. The caching system in this module expects that event instances will not be mutated by external sources.

Hierarchy

  • LogEvent

Implements

Constructors

  • Parameters

    • level: number
    • tag: string
    • message: string
    • Optional params: any[]
    • Optional timestamp: number

    Returns LogEvent

Properties

level: number
message: string
params: undefined | any[]
tag: string
timestamp: number

Methods

  • Make a copy of this instance. Useful if you want to buffer events without disabling event caching at the transport level.

    Returns LogEvent

  • See stringifyAndJoin for argument details.

    Parameters

    • Optional parameterSeparator: string
    • Optional stringifyMaxLength: number

    Returns string

  • Used by the caching system to recycle existing event instances. It is not recommended to use this directly.

    Parameters

    • level: number
    • tag: string
    • message: string
    • params: undefined | any[] = undefined
    • timestamp: number = ...

    Returns void

  • Parameters

    • Optional ignoreParams: boolean
    • Optional levelNameMap: LogLevelNameMap
    • Optional parameterSeparator: string
    • Optional stringifyMaxLength: number

    Returns string

  • Convenience api akin to JSON.stringify().

    Parameters

    • ev: LogEventLike
    • Optional ignoreParams: boolean
    • Optional levelNameMap: LogLevelNameMap
    • Optional parameterSeparator: string
    • Optional stringifyMaxLength: number

    Returns string

Generated using TypeDoc