Stand-in for console object usage.

Instead of calling console.log() / console.warn() / etc. and losing the information immediately to the javascript runtime, this will pack the information in the call into a LogEvent, which can then have zero or more post-processing routines run on it, and be emitted to zero or more event observers in the parent LoggerTransport.

In general, there should be at least one new Logger instance per file and / or scope in your project.

Hierarchy

Implements

Constructors

Properties

guard: LogEventGuard = ...
name: string
transport: LoggerTransport = ...

Methods

  • Parameters

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

    Returns LogEvent

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

  • Parameters

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

    Returns void

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

  • Set the enabled state of this instance, regarding whether or not it will emit any log events. When true, emits events as normal; when false, suppresses all events.

    The main benefit of this is to temorarily suppress all events on this instance, while keeping the currently set filter in-tact.

    e.g. If this instance has a custom filter set, and then is disabled, when this is re-enabled later it will continue using the custom filter.

    Parameters

    • enabled: boolean

    Returns Logger

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

  • Parameters

    • message: string
    • Rest ...params: any[]

    Returns void

Generated using TypeDoc