Hierarchy

  • ConsoleLogger
    • AppLogger

Constructors

  • Returns AppLogger

  • Parameters

    • context: string

    Returns AppLogger

  • Parameters

    • context: string
    • options: ConsoleLoggerOptions

    Returns AppLogger

Properties

context?: string
options: ConsoleLoggerOptions

Methods

  • Parameters

    • message: string
    • logLevel: LogLevel

    Returns string

  • Write a 'debug' level log, if the configured level allows for it. Prints to stdout with newline.

    Parameters

    • message: any
    • Optionalcontext: string

    Returns void

  • Write a 'debug' level log.

    Parameters

    • message: any
    • Rest...optionalParams: any[]

    Returns void

  • Write an 'error' level log, if the configured level allows for it. Prints to stderr with newline.

    Parameters

    • message: any
    • OptionalstackOrContext: string

    Returns void

  • Write an 'error' level log.

    Parameters

    • message: any
    • Optionalstack: string
    • Optionalcontext: string

    Returns void

  • Write an 'error' level log.

    Parameters

    • message: any
    • Rest...optionalParams: any[]

    Returns void

  • Parameters

    • context: string

    Returns string

  • Parameters

    • logLevel: LogLevel
    • message: unknown
    • pidMessage: string
    • formattedLogLevel: string
    • contextMessage: string
    • timestampDiff: string

    Returns string

  • Parameters

    • pid: number

    Returns string

  • Parameters

    • timestampDiff: number

    Returns string

  • Returns string

  • Parameters

    • level: LogLevel

    Returns boolean

  • Write a 'log' level log, if the configured level allows for it. Prints to stdout with newline.

    Parameters

    • message: any
    • Optionalcontext: string

    Returns void

  • Write a 'log' level log.

    Parameters

    • message: any
    • Rest...optionalParams: any[]

    Returns void

  • Parameters

    • messages: unknown[]
    • context: string = ''
    • logLevel: LogLevel = 'log'

    Returns void

  • Parameters

    • stack: string

    Returns void

  • Resets the logger context to the value that was passed in the constructor.

    Returns void

  • Set logger context

    Parameters

    • context: string

      context

    Returns void

  • Set log levels

    Parameters

    • levels: LogLevel[]

      log levels

    Returns void

  • Parameters

    • message: unknown
    • logLevel: LogLevel

    Returns any

  • Returns string

  • Write a 'verbose' level log, if the configured level allows for it. Prints to stdout with newline.

    Parameters

    • message: any
    • Optionalcontext: string

    Returns void

  • Write a 'verbose' level log.

    Parameters

    • message: any
    • Rest...optionalParams: any[]

    Returns void

  • Write a 'warn' level log, if the configured level allows for it. Prints to stdout with newline.

    Parameters

    • message: any
    • Optionalcontext: string

    Returns void

  • Write a 'warn' level log.

    Parameters

    • message: any
    • Rest...optionalParams: any[]

    Returns void