@nowarajs/logger
    Preparing search index...

    Interface LoggerSink<TLogObject, TConfig>

    interface LoggerSink<TLogObject = unknown, TConfig = unknown> {
        config?: TConfig;
        close?(): void | Promise<void>;
        log(
            level: LogLevels,
            timestamp: number,
            object: TLogObject,
        ): void | Promise<void>;
    }

    Type Parameters

    • TLogObject = unknown
    • TConfig = unknown

    Implemented by

    Index

    Properties

    Methods

    Properties

    config?: TConfig

    Optional configuration for the sink

    Methods

    • Closes the sink and flushes any pending logs. This method is called when the logger is closing to ensure all resources are properly released. Optional - implement this if your sink needs cleanup (e.g., closing file handles, database connections).

      Returns void | Promise<void>

    • Logs a message with the sink's implementation. If you want to create your own sink, you must implement this method and all imports must be in the form of dynamic imports.

      Parameters

      • level: LogLevels

        The log level at which the message should be logged.

      • timestamp: number

        The date at which the message was logged.

      • object: TLogObject

        The object to log.

      Returns void | Promise<void>