/** * @file Logging Utilities * @description Centralized logging with levels and context */ /** * Log levels */ export type LogLevel = 'debug' | 'info' | 'warn' | 'error'; /** * Logger configuration */ export interface LoggerConfig { /** Minimum log level */ level: LogLevel; /** Enable console output */ console: boolean; /** Enable remote logging */ remote: boolean; /** Remote logging endpoint */ remoteEndpoint?: string; /** Include timestamp */ timestamp: boolean; /** Include caller info */ caller: boolean; /** Custom log handler */ handler?: (entry: LogEntry) => void; } /** * Log entry */ export interface LogEntry { level: LogLevel; message: string; timestamp: Date; context?: Record; caller?: string; tags?: string[]; } /** * Configure logger */ export declare function configureLogger(config: Partial): void; /** * Get current configuration */ export declare function getLoggerConfig(): LoggerConfig; /** * Logger object */ export declare const logger: { debug: (message: string, context?: Record, tags?: string[]) => void; info: (message: string, context?: Record, tags?: string[]) => void; warn: (message: string, context?: Record, tags?: string[]) => void; error: (message: string, context?: Record, tags?: string[]) => void; /** * Create a logger with preset tags */ withTags: (...tags: string[]) => { debug: (message: string, context?: Record) => void; info: (message: string, context?: Record) => void; warn: (message: string, context?: Record) => void; error: (message: string, context?: Record) => void; }; /** * Create a logger with preset context */ withContext: (baseContext: Record) => { debug: (message: string, context?: Record) => void; info: (message: string, context?: Record) => void; warn: (message: string, context?: Record) => void; error: (message: string, context?: Record) => void; }; }; /** * Performance logging helper */ export declare function logPerformance(label: string): () => void; /** * Measure async function performance */ export declare function measureAsync(label: string, fn: () => Promise): Promise;