UNPKG

@just-in/core

Version:

A TypeScript-first framework for building adaptive digital health interventions.

54 lines 2.31 kB
import { Logger } from './logger.interface'; /** Configuration for enabling or disabling specific log levels. */ export declare const logLevels: { info: boolean; warn: boolean; error: boolean; dev: boolean; }; /** * Sets a custom logger to replace the default ConsoleLogger. * If no method is provided by the custom logger, the default ConsoleLogger method will be used. * @param {Partial<Logger>} logger - The custom logger implementation to use. */ export declare function setLogger(logger: Partial<Logger>): void; /** * Updates the log levels that are enabled or disabled. * Allows selective control over which log levels should be active. * @param {Partial<typeof logLevels>} levels - An object specifying the log levels to enable or disable. * @example * // Enable only error and debug logs * setLogLevels({ info: false, warn: false, error: true, debug: true }); */ export declare function setLogLevels(levels: Partial<typeof logLevels>): void; /** * Provides a unified logging interface that respects log level configuration. * Each log method will only output if its corresponding log level is enabled. */ export declare const Log: { /** * Logs an informational message if `info` logging is enabled. * @param {string} message - The message to log. * @param {...any[]} optionalParams - Additional parameters for the log. */ info(message: string, ...optionalParams: any[]): void; /** * Logs a warning message if `warn` logging is enabled. * @param {string} message - The message to log. * @param {...any[]} optionalParams - Additional parameters for the log. */ warn(message: string, ...optionalParams: any[]): void; /** * Logs an error message if `error` logging is enabled. * @param {string} message - The message to log. * @param {...any[]} optionalParams - Additional parameters for the log. */ error(message: string, ...optionalParams: any[]): void; /** * Logs a message if `dev` logging is enabled and env var NODE_ENV === 'dev'. * @param {string} message - The message to log. * @param {...any[]} optionalParams - Additional parameters for the log. */ dev(message: string, ...optionalParams: any[]): void; }; //# sourceMappingURL=logger-manager.d.ts.map