@map-colonies/js-logger
    Preparing search index...

    Interface LoggerOptions

    Options for configuring the logger.

    interface LoggerOptions {
        base?: null | { [key: string]: any };
        enabled?: boolean;
        hooks?: {
            logMethod?: (
                this: Logger,
                args: [msg: string, ...args: any[]],
                method: LogFn,
                level: number,
            ) => void;
            streamWrite?: (s: string) => string;
        };
        level?: LevelWithSilentOrString;
        mixin?: MixinFn<never>;
        pinoCaller?: boolean;
        prettyPrint?: boolean;
        redact?: string[] | redactOptions;
    }
    Index

    Properties

    base?: null | { [key: string]: any }

    Base properties to include in log output.

    enabled?: boolean

    Determines if logging is enabled.

    hooks?: {
        logMethod?: (
            this: Logger,
            args: [msg: string, ...args: any[]],
            method: LogFn,
            level: number,
        ) => void;
        streamWrite?: (s: string) => string;
    }

    Hooks for customizing log behavior.

    Type declaration

    • OptionallogMethod?: (
          this: Logger,
          args: [msg: string, ...args: any[]],
          method: LogFn,
          level: number,
      ) => void

      Allows for manipulating the parameters passed to logger methods. The signature for this hook is logMethod (args, method, level) {}, where args is an array of the arguments that were passed to the log method and method is the log method itself, and level is the log level. This hook must invoke the method function by using apply, like so: method.apply(this, newArgumentsArray).

    • OptionalstreamWrite?: (s: string) => string

      Allows for manipulating the stringified JSON log output just before writing to various transports. This function must return a string and must be valid JSON.

    level?: LevelWithSilentOrString

    Specifies the logging level.

    mixin?: MixinFn<never>

    Function to add custom properties to log output.

    pinoCaller?: boolean

    Includes the caller's file and line number in log output.

    prettyPrint?: boolean

    Enables pretty-printing of log output.

    redact?: string[] | redactOptions

    Defines paths to redact from log output.