Class Logger

Dispatches logged messages to channels.

Hierarchy

  • Logger

Implements

Constructors

  • Creates the new Logger instance.

    Parameters

    • level: number = 0

      The minimum log level of messages that would be dispatched to channels.

    • Optional context: any

      The context that is added to dispatched messages.

    Returns Logger

Properties

channels: LoggerChannel[] = []

The list of channels.

context?: any

The context that is added to dispatched messages.

level: number = 0

The minimum log level of messages that would be dispatched to channels.

log: ((...args) => void) = ...

Type declaration

    • (...args): void
    • The alias for info.

      Parameters

      • Rest ...args: any[]

      Returns void

Accessors

  • get debugEnabled(): boolean
  • Returns boolean

  • get errorEnabled(): boolean
  • Returns boolean

  • get fatalEnabled(): boolean
  • Returns boolean

  • get infoEnabled(): boolean
  • Returns boolean

  • get traceEnabled(): boolean
  • Returns boolean

  • get warnEnabled(): boolean
  • Returns boolean

Methods

  • Log a fine-grained informational message that are most useful to debug an application.

    Parameters

    • Rest ...args: any[]

    Returns void

  • Parameters

    • level: number

      The message severity level.

    • args: any[]

      The array of arguments.

    • context: any = ...

      The optional message context.

    Returns void

  • Log an error event that might still allow the application to continue running.

    Parameters

    • Rest ...args: any[]

    Returns void

  • Log a very severe error events that will presumably lead the application to abort.

    Parameters

    • Rest ...args: any[]

    Returns void

  • Log an informational message that highlight the progress of the application at coarse-grained level.

    Parameters

    • Rest ...args: any[]

    Returns void

  • Deletes all channels from the logger and resets the log level.

    Parameters

    • level: number = 0

      The new log level.

    Returns Logger

    This logger instance.

  • Log a finer-grained informational message than the debug, usually with a stack trace.

    Parameters

    • Rest ...args: any[]

    Returns void

  • Log a potentially harmful situation.

    Parameters

    • Rest ...args: any[]

    Returns void