Options
All
  • Public
  • Public/Protected
  • All
Menu

A logger based on actions.

Hierarchy

Index

Constructors

constructor

  • new ActionLogger(options?: EventEmitterOptions): ActionLogger

Properties

Private _actions

_actions: any

Private _filters

_filters: any

Static Readonly captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

addAction

  • Adds a new action.

    chainable

    Parameters

    Returns ActionLogger

    this

addFilter

  • Adds a new filter.

    chainable

    Parameters

    Returns ActionLogger

    this

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): ActionLogger
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns ActionLogger

alert

  • Logs an alert message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

clear

  • Clears anything of that logger.

    chainable

    Returns ActionLogger

    this

clearActions

  • Clears the action list.

    chainable

    Returns ActionLogger

    this

clearFilters

  • Clears the filter list.

    chainable

    Returns ActionLogger

    this

crit

  • Logs a critical message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

debug

  • Logs a debug message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

emerg

  • Logs an emergency message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

err

  • Logs an error message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number

info

  • Logs an info message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

log

  • log(type: LogType, msg: any, tag?: string): Promise<void>
  • Logs a message.

    inheritdoc

    Parameters

    • type: LogType
    • msg: any
    • Optional tag: string

    Returns Promise<void>

Protected logSync

  • Sync logging.

    Parameters

    • type: LogType

      The type.

    • msg: any

      The message.

    • Optional tag: string

    Returns ActionLogger

Protected normalizeTag

  • normalizeTag(tag: string): string
  • Normalizes a tag value.

    Parameters

    • tag: string

      The input value.

    Returns string

    The output value.

notice

  • Logs a note message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

off

  • off(event: string | symbol, listener: (...args: any[]) => void): ActionLogger
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns ActionLogger

on

  • on(event: string | symbol, listener: (...args: any[]) => void): ActionLogger
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns ActionLogger

Protected onLog

  • inheritdoc

    Parameters

    Returns Promise<void>

once

  • once(event: string | symbol, listener: (...args: any[]) => void): ActionLogger
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns ActionLogger

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): ActionLogger
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns ActionLogger

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): ActionLogger
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns ActionLogger

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): ActionLogger
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns ActionLogger

setMaxListeners

trace

  • Logs a trace message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

warn

  • Logs a warning message.

    inheritdoc

    Parameters

    • msg: any
    • Optional tag: string

    Returns ActionLogger

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc