UNPKG

lever-ui-logger

Version:

Zero-dependency logging library with optional EventBus integration. Built-in PII redaction, multiple transports, and comprehensive logging capabilities.

43 lines 1.44 kB
/** * Logger configuration types and default values */ import type { LogLevel, LoggerConfig, Transport } from './types.js'; /** * Default log level for new loggers */ export declare const DEFAULT_LOG_LEVEL: LogLevel; /** * Log level hierarchy for comparison * Higher numbers indicate higher priority */ export declare const LOG_LEVEL_PRIORITY: Record<LogLevel, number>; /** * Default logger configuration */ export declare const DEFAULT_LOGGER_CONFIG: Required<Omit<LoggerConfig, 'transports'>> & { transports: Transport[]; }; /** * Merges user configuration with defaults * * @param userConfig - User-provided configuration * @returns Complete configuration with defaults applied */ export declare function mergeConfig(userConfig?: LoggerConfig): Required<LoggerConfig>; /** * Checks if a log level should be processed based on current minimum level * * @param level - Log level to check * @param minLevel - Minimum log level configured * @returns True if log should be processed */ export declare function shouldLog(level: LogLevel, minLevel: LogLevel): boolean; /** * Applies sampling to determine if a log should be processed * * @param level - Log level * @param samplingRates - Sampling configuration * @returns True if log passes sampling check */ export declare function passesSampling(level: LogLevel, samplingRates: Partial<Record<LogLevel, number>>): boolean; //# sourceMappingURL=logger-config.d.ts.map