import type { ILogger, ILoggerOptions, LogLevel, IStructuredLog, IStructuredLogger, ILogContext, LogEvent } from '../../domain/interfaces'; /** * Default logger configuration. */ export declare const DEFAULT_LOGGER_OPTIONS: ILoggerOptions; /** * Extended logger options with async support. */ export interface ILoggerOptionsExtended extends ILoggerOptions { /** Use async file writes (fire-and-forget, non-blocking). Default: false. */ asyncWrites?: boolean; } /** * Simple file-based logger implementation. * Writes single-line formatted logs with optional colorized console output. * Also implements IStructuredLogger for standardized event logging. * * Supports async (non-blocking) file writes for performance-sensitive contexts * like Claude Code hooks where latency matters. */ export declare class Logger implements ILogger, IStructuredLogger { private readonly options; private readonly getCorrelationId; private readonly logFile; private readonly bindings; private readonly boundContext; private readonly asyncWrites; constructor(options: ILoggerOptionsExtended, _pinoInstance?: unknown, // Kept for API compatibility getCorrelationId?: () => string | undefined, bindings?: Record, boundContext?: ILogContext); /** * Ensure log directory exists. */ private ensureLogDir; /** * Check if a log level should be output. */ private shouldLog; /** * Format context object as compact JSON string. */ private formatContext; /** * Write a log entry. * Uses async (fire-and-forget) writes when asyncWrites is enabled. */ private writeLog; trace(message: string, context?: Record): void; debug(message: string, context?: Record): void; info(message: string, context?: Record): void; warn(message: string, context?: Record): void; error(message: string, context?: Record): void; fatal(message: string, context?: Record): void; child(bindings: Record): ILogger; /** * Format a structured log entry into message and context. * * Note: log.data is flattened into the context object intentionally for better * compatibility with log aggregation tools (Elasticsearch, Datadog, etc.) that * prefer flat structures. Callers should avoid using keys in log.data that * conflict with reserved context fields (event, sessionId, groupId, etc.). */ private formatStructuredLog; /** * Log a structured event at info level. */ logEvent(log: IStructuredLog): void; /** * Log a structured event at debug level. */ logEventDebug(log: IStructuredLog): void; /** * Log a structured event at warn level. */ logEventWarn(log: IStructuredLog): void; /** * Log a structured event at error level. */ logEventError(log: IStructuredLog): void; /** * Create a child logger with bound context. */ withContext(context: ILogContext): IStructuredLogger; /** * Start a timed operation and return a function to complete it. */ startOperation(event: LogEvent | string, context?: ILogContext): (result?: { data?: Record; error?: string; }) => void; isLevelEnabled(level: LogLevel): boolean; } /** * No-op logger for testing or when logging is disabled. */ export declare class NullLogger implements ILogger, IStructuredLogger { trace(_message: string, _context?: Record): void; debug(_message: string, _context?: Record): void; info(_message: string, _context?: Record): void; warn(_message: string, _context?: Record): void; error(_message: string, _context?: Record): void; fatal(_message: string, _context?: Record): void; child(_bindings: Record): ILogger; isLevelEnabled(_level: LogLevel): boolean; logEvent(_log: IStructuredLog): void; logEventDebug(_log: IStructuredLog): void; logEventWarn(_log: IStructuredLog): void; logEventError(_log: IStructuredLog): void; withContext(_context: ILogContext): IStructuredLogger; startOperation(_event: LogEvent | string, _context?: ILogContext): (result?: { data?: Record; error?: string; }) => void; } //# sourceMappingURL=Logger.d.ts.map