@ckirg/corelib - v0.4.1
    Preparing search index...

    Interface StrictLogger

    StrictLogger Interface Defines a consistent API across all runtimes (Node, Bun, Deno, Cloudflare, etc.) This ensures that logging behavior is predictable and uniform regardless of the deployment target.

    interface StrictLogger {
        bindings: () => Record<string, unknown>;
        child: (bindings: Record<string, unknown>) => StrictLogger;
        debug: LogMethod;
        error: LogMethod;
        fatal: LogMethod;
        flush: (cb?: (err?: Error | null) => void) => void;
        info: LogMethod;
        level: string;
        levelVal: number;
        setTelemetry: (mode: "on" | "off") => void;
        silent: () => void;
        trace: LogMethod;
        warn: LogMethod;
    }
    Index
    bindings: () => Record<string, unknown>

    Returns the current bindings of the logger.

    Type Declaration

      • (): Record<string, unknown>
      • Returns Record<string, unknown>

        The current bindings.

    child: (bindings: Record<string, unknown>) => StrictLogger

    Creates a child logger with additional bindings. Child loggers inherit the parent's configuration but add their own metadata.

    Type Declaration

      • (bindings: Record<string, unknown>): StrictLogger
      • Parameters

        • bindings: Record<string, unknown>

          Metadata to bind to all logs from the child logger.

        Returns StrictLogger

        A new logger instance.

    debug: LogMethod

    Logs at the 'debug' level.

    error: LogMethod

    Logs at the 'error' level.

    fatal: LogMethod

    Logs at the 'fatal' level (highest priority).

    flush: (cb?: (err?: Error | null) => void) => void

    Flush any buffered log output (e.g. pino's sonic-boom buffer). Safe to call as a no-op when no buffer is in use.

    Type Declaration

      • (cb?: (err?: Error | null) => void): void
      • Parameters

        • Optionalcb: (err?: Error | null) => void

          Optional callback called after flushing.

        Returns void

    info: LogMethod

    Logs at the 'info' level (default).

    level: string

    Current log level as a string (e.g., 'info', 'debug').

    levelVal: number

    Current log level as a numeric value.

    setTelemetry: (mode: "on" | "off") => void

    Enables or disables system telemetry injection in log entries.

    Type Declaration

      • (mode: "on" | "off"): void
      • Parameters

        • mode: "on" | "off"

          The telemetry mode.

        Returns void

    silent: () => void

    Sets the log level to 'silent', disabling all output.

    trace: LogMethod

    Logs at the 'trace' level (most verbose).

    warn: LogMethod

    Logs at the 'warn' level.