import { LogEntry, RequestContext } from '../types'; export type { LogEntry }; export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error'; export interface Logger { trace(component: string, message: string, metadata?: any): void; debug(component: string, message: string, metadata?: any): void; info(component: string, message: string, metadata?: any): void; warn(component: string, message: string, metadata?: any): void; error(component: string, message: string, error?: Error, metadata?: any): void; trace(component: string, message: string, metadata?: any): void; debug(component: string, message: string, metadata?: any): void; info(component: string, message: string, metadata?: any): void; warn(component: string, message: string, metadata?: any): void; error(component: string, message: string, error?: Error, metadata?: any): void; log(level: LogLevel, component: string, message: string, metadata?: any, error?: Error): void; runWithRequestContext(context: RequestContext, fn: () => T): T; setRequestContext(context: RequestContext): void; clearRequestContext(): void; isLevelEnabled(component: string, level: LogLevel): boolean; reinitialize(): void; /** Takes the levels of a configuration the service received (not read from the file); undefined restores the constructed level and clears the components. */ applyLoggingConfig(logging: { defaultLevel?: string; components?: Record; } | undefined): void; /** The environment variables that fix a setting whatever the configuration says. */ fixedByEnvironment(): { LOG_LEVEL?: string; }; /** * A second output beside the console: called with each entry after it was written. It must only * queue and return; an exception from it is swallowed. Returns the function that removes it. */ addSink(sink: (entry: LogEntry) => void): () => void; close(): void; stream: { write: (message: string) => void; }; } export interface LogConfig { level: LogLevel; format: 'json' | 'simple' | 'combined'; transports: LogTransport[]; enableColors: boolean; enableTimestamp: boolean; enableRequestId: boolean; componentLevels?: Record; logFolderPath?: string; configFilePath?: string; enableFileLogging?: boolean; maxFileSize?: number; maxFiles?: number; } export interface LogTransport { type: 'console' | 'file' | 'http'; level?: LogLevel; config?: { filename?: string; maxsize?: number; maxFiles?: number; url?: string; headers?: Record; }; } export declare function createSafePreview(data: any, maxLength?: number): string; export declare function createHeadersPreview(headers: Record | null | undefined): string; export declare function createLogger(config?: Partial): Logger; export declare function getDefaultLogger(): Logger; export declare function setDefaultLogger(logger: Logger): void; export declare const logger: Logger; export default logger;