Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Callable

  • ExtendedLogger(context: string | LogMessageOptions, ...details: unknown[]): void
  • ExtendedLogger(context: string | LogMessageOptions, error: Error, ...details: unknown[]): void

Index

Methods

  • error(context: string, ...details: unknown[]): void
  • error(context: string, error: Error, ...details: unknown[]): void
  • Logs a message with the error level and specified context

    Parameters

    • context: string

      log record context

    • Rest ...details: unknown[]

    Returns void

  • Logs a message with the error level and specified context

    Parameters

    • context: string

      log record context

    • error: Error

      thrown error

    • Rest ...details: unknown[]

    Returns void

  • info(context: string, ...details: unknown[]): void
  • Logs a message with the info level and specified context

    Parameters

    • context: string

      log record context

    • Rest ...details: unknown[]

    Returns void

  • Returns a new logging function with the specified namespace

    example
    const log2 = log.namespace('global');
    log2.info('res', 'hello');
    // Prints context 'global:res'

    const log3 = log.namespace('super').namespace('global');
    log3.info('res', 'hello');
    // Prints context 'super:global:res'

    Parameters

    • value: string

    Returns ExtendedLogger

  • warn(context: string, ...details: unknown[]): void
  • warn(context: string, error: Error, ...details: unknown[]): void
  • Logs a message with the warning level and specified context

    Parameters

    • context: string

      log record context

    • Rest ...details: unknown[]

    Returns void

  • Logs a message with the warning level and specified context

    Parameters

    • context: string

      log record context

    • error: Error

      thrown error

    • Rest ...details: unknown[]

    Returns void