Logs messages, with convenience methods to log on a specific level.

getLoggerFor on how to instantiate loggers.

interface Logger {
    debug: ((message: string) => Logger);
    error: ((message: string) => Logger);
    info: ((message: string) => Logger);
    log: ((level:
        | "error"
        | "warn"
        | "info"
        | "verbose"
        | "debug"
        | "silly", message: string, meta?: LogMetadata) => Logger);
    silly: ((message: string) => Logger);
    verbose: ((message: string) => Logger);
    warn: ((message: string) => Logger);
}

Hierarchy (view full)

Implemented by

Properties

debug: ((message: string) => Logger)

Log a message at the 'debug' level.

Type declaration

    • (message): Logger
    • Parameters

      • message: string

        The message to log.

      Returns Logger

error: ((message: string) => Logger)

Log a message at the 'error' level.

Type declaration

    • (message): Logger
    • Parameters

      • message: string

        The message to log.

      Returns Logger

info: ((message: string) => Logger)

Log a message at the 'info' level.

Type declaration

    • (message): Logger
    • Parameters

      • message: string

        The message to log.

      Returns Logger

log: ((level:
    | "error"
    | "warn"
    | "info"
    | "verbose"
    | "debug"
    | "silly", message: string, meta?: LogMetadata) => Logger)

Log the given message at the given level. If the internal level is higher than the given level, the message may be voided.

Type declaration

    • (level, message, meta?): Logger
    • Parameters

      • level:
            | "error"
            | "warn"
            | "info"
            | "verbose"
            | "debug"
            | "silly"

        The level to log at.

      • message: string

        The message to log.

      • Optionalmeta: LogMetadata

        Optional metadata to include in the log message.

      Returns Logger

silly: ((message: string) => Logger)

Log a message at the 'silly' level.

Type declaration

    • (message): Logger
    • Parameters

      • message: string

        The message to log.

      Returns Logger

verbose: ((message: string) => Logger)

Log a message at the 'verbose' level.

Type declaration

    • (message): Logger
    • Parameters

      • message: string

        The message to log.

      Returns Logger

warn: ((message: string) => Logger)

Log a message at the 'warn' level.

Type declaration

    • (message): Logger
    • Parameters

      • message: string

        The message to log.

      Returns Logger