UNPKG

lever-ui-logger

Version:

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

50 lines 2.35 kB
/** Core Logger Implementation - Standalone logger with transport system */ import type { Logger, LoggerConfig, LogLevel, Transport } from './types.js'; /** Core standalone logger implementation with transport system */ export declare class LoggerImpl implements Logger { private readonly loggerName; private readonly transportRegistry; private readonly configuration; private readonly contextManager; private readonly redactionEngine; private destroyed; /** Creates a new logger instance */ constructor(config?: LoggerConfig, loggerName?: string); /** Logger name/identifier */ get name(): string; /** Current minimum log level */ get level(): LogLevel; /** Logs a trace-level message */ trace(message: string, ...args: readonly unknown[]): void; /** Logs a debug-level message */ debug(message: string, ...args: readonly unknown[]): void; /** Logs an info-level message */ info(message: string, ...args: readonly unknown[]): void; /** Logs a warning-level message */ warn(message: string, ...args: readonly unknown[]): void; /** Logs an error-level message */ error(message: string, ...args: readonly unknown[]): void; /** Records a structured metric */ metric(name: string, fields?: Record<string, number | string | boolean>): void; /** Creates a child logger with additional context */ withContext(additionalContext: Record<string, unknown>): Logger; /** Sets the minimum log level for this logger */ setLevel(level: LogLevel): void; /** Sets log level for a specific component */ setComponentLevel(component: string, level: LogLevel): void; /** Explicitly redacts a value using the configured redaction engine */ redact(value: unknown): string; /** Adds a transport to this logger */ addTransport(transport: Transport): void; /** Removes a transport from this logger */ removeTransport(transportName: string): boolean; /** Flushes all transports */ flush(): Promise<void>; /** Destroys the logger and cleans up resources */ destroy(): Promise<void>; /** Core logging method that handles all log levels */ private log; } /** Creates a new standalone logger instance */ export declare function createLogger(config?: LoggerConfig): Logger; //# sourceMappingURL=logger-impl.d.ts.map