Interface for a logger.

interface LoggerInterface {
    attachTo: (app: ZibriApplication) => void | Promise<void>;
    critical: (error: Error, context?: LogContextInput) => void | Promise<void>;
    debug: (message: string, context?: LogContextInput) => void | Promise<void>;
    error: (error: Error, context?: LogContextInput) => void | Promise<void>;
    info: (message: string, context?: LogContextInput) => void | Promise<void>;
    transports: LoggerTransport<BaseLoggerTransportConfig>[];
    warn: (message: string, context?: LogContextInput) => void | Promise<void>;
}

Implemented by

Properties

attachTo: (app: ZibriApplication) => void | Promise<void>

Attaches the service to the Zibri application.

critical: (error: Error, context?: LogContextInput) => void | Promise<void>

Logs a critical error.

debug: (message: string, context?: LogContextInput) => void | Promise<void>

Logs a debug message.

error: (error: Error, context?: LogContextInput) => void | Promise<void>

Logs a error.

info: (message: string, context?: LogContextInput) => void | Promise<void>

Logs a info message.

The transports to be used by the logger.

warn: (message: string, context?: LogContextInput) => void | Promise<void>

Logs a warning.