Class OINOLogAbstract

Abstract base class for logging implementations supporting

  • error, warning, info and debug channels
  • setting level of logs outputted

Hierarchy (view full)

Constructors

Methods

  • Log debug event. Debug events are prettyprinted.

    Parameters

    • domain: string

      domain of the log event

    • channel: string

      channel of the log event

    • method: string

      method of the log event

    • message: string

      message of the log event

    • Optional data: any

      structured data associated with the log event

    Returns void

  • Log error event. Error events are printed as a single line.

    Parameters

    • domain: string

      domain of the log event

    • channel: string

      channel of the log event

    • method: string

      method of the log event

    • message: string

      message of the log event

    • Optional data: any

      structured data associated with the log event

    Returns void

  • Log exception event. Exception events are prettyprinted and preserve newlines so that stack traces are readable.

    Parameters

    • domain: string

      domain of the log event

    • channel: string

      channel of the log event

    • method: string

      method of the log event

    • message: string

      message of the log event

    • Optional data: any

      structured data associated with the log event

    Returns void

  • Get current log levels as an array of objects with domain, channel, method and level.

    Returns any[]

  • Import log levels from an array of objects with domain, channel, method and level.

    Parameters

    • logLevels: any[]

      array of log level objects

    Returns void

  • Log info event. Info events are printed as a single line.

    Parameters

    • domain: string

      domain of the log event

    • channel: string

      channel of the log event

    • method: string

      method of the log event

    • message: string

      message of the log event

    • Optional data: any

      structured data associated with the log event

    Returns void

  • Set log level for given combination of domain/channel/method. Not defining dimension(s) means they match any value. Multiple settings can be combined to set different logging accuracy specifically

    For example: logLevel: warning, domain: *, channel: , method: * will only output error events. logLevel: debug, domain: d1, channel: c1, method: "" will enable debug events for channel c1 of domain d1. logLevel: info, domain: d1, channel: c1, method: m1 will supress debug events for method m1.

    Parameters

    • logLevel: OINOLogLevel

      log level to use

    • domain: string = ""

      domain of the log event (default: "*" for all)

    • channel: string = ""

      channel of the log event (default: "*" for all)

    • method: string = ""

      method of the log event (default: "*" for all)

    Returns void

  • Log warning event. Warning events are printed as a single line.

    Parameters

    • domain: string

      domain of the log event

    • channel: string

      channel of the log event

    • method: string

      method of the log event

    • message: string

      message of the log event

    • Optional data: any

      structured data associated with the log event

    Returns void