Class LogService

LogService
Represents a logging service that provides methods for logging messages with different severity levels.

Example

const logger = new LogService('MyContext')
logger.log('This is an info message').into(Emitter.CONSOLE)

Constructors

Properties

Methods

Constructors

  • Creates a new instance of the LogService.

    Parameters

    • context: string

      The context for the logger service.

    • Optional options: Options

    Returns LogService

    Example

    const logger = new LogService('MyContext')
    logger.log('This is an info message').into(Emitter.CONSOLE)
  • Parameters

    • context: OptionsWithContext

    Returns LogService

Properties

context: string
options: Options

Methods

  • Parameters

    • Rest ...msg: any[]

      The message to be logged.

    Returns Message

    A Message object with the specified message, severity level set to 'ERROR', and the current context.

    Method

    error
    Logs a message with the 'ERROR' severity level.

  • Parameters

    • Rest ...msg: any[]

      The message to be logged.

    Returns Message

    A Message object with the specified message, severity level set to 'INFO', and the current context.

    Method

    log
    Logs a message with the 'INFO' severity level.

  • Parameters

    • Rest ...msg: any[]

      The message to be logged.

    Returns Message

    A Message object with the specified message, severity level set to 'WARN', and the current context.

    Method

    warn
    Logs a message with the 'WARN' severity level.

Generated using TypeDoc