UNPKG

@wgtechlabs/log-engine

Version:

A lightweight, security-first logging utility with automatic data redaction for Node.js applications - the first logging library with built-in PII protection.

36 lines 1.5 kB
/** * Log level and mode filtering logic * Handles the decision logic for whether messages should be logged */ import { LogLevel, LogMode } from '../types'; /** * Filtering logic for log messages based on levels and modes * Determines whether a message should be output based on current configuration */ export declare class LogFilter { private static readonly SEVERITY_RANKS; private static readonly MODE_THRESHOLDS; /** * Determines if a message should be logged based on current log mode * Messages are shown only if their level is appropriate for the configured mode * LOG level is special - it always outputs regardless of configured mode (except when OFF is set) * OFF mode disables all logging including LOG level messages * @param level - The log level of the message to check * @param currentMode - The current logging mode * @returns true if message should be logged, false otherwise */ static shouldLog(level: LogLevel, currentMode: LogMode): boolean; /** * Get the severity rank for a log level * @param level - The log level to get rank for * @returns Numeric severity rank */ static getSeverityRank(level: LogLevel): number; /** * Get the threshold for a log mode * @param mode - The log mode to get threshold for * @returns Numeric threshold value */ static getModeThreshold(mode: LogMode): number; } //# sourceMappingURL=filtering.d.ts.map