Hierarchy

  • ConsoleLogger
    • NestSystemLogger

Constructors

  • Returns NestSystemLogger

  • Parameters

    • context: string

    Returns NestSystemLogger

  • Parameters

    • options: ConsoleLoggerOptions

    Returns NestSystemLogger

  • Parameters

    • context: string
    • options: ConsoleLoggerOptions

    Returns NestSystemLogger

Properties

context?: string

The context of the logger (can be set manually or automatically inferred).

inspectOptions: InspectOptions

The options used for the "inspect" method.

options: ConsoleLoggerOptions

The options of the logger.

originalContext?: string

The original context of the logger (set in the constructor).

lastTimestampAt?: number

The last timestamp at which the log message was printed.

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, if the configured level allows for it. Prints to stdout with newline.

    Parameters

    • message: any
    • ...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, if the configured level allows for it. Prints to stderr with newline.

    Parameters

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

    Returns void

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

    Parameters

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

    Returns void

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

    Parameters

    • message: any
    • Optionalcontext: string

    Returns void

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

    Parameters

    • message: any
    • ...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 InspectOptions

  • 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, if the configured level allows for it. Prints to stdout with newline.

    Parameters

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

    Returns void

  • Parameters

    • message: unknown
    • options: {
          context: string;
          errorStack?: unknown;
          logLevel: LogLevel;
          writeStreamType?: "stdout" | "stderr";
      }

    Returns void

  • Parameters

    • messages: unknown[]
    • Optionalcontext: string
    • OptionallogLevel: LogLevel

    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

    Returns string

  • Parameters

    • key: string
    • value: unknown

    Returns unknown

  • 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, if the configured level allows for it. Prints to stdout with newline.

    Parameters

    • message: any
    • ...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, if the configured level allows for it. Prints to stdout with newline.

    Parameters

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

    Returns void