import { LoggerRepository } from '../repositories/logger-repository'; import { LogEvent } from '../types/log-event'; export declare class LoggerAggregator { private readonly loggerRepository; private readonly options; private storage; constructor(loggerRepository: LoggerRepository, options?: { debug?: boolean; }); /** * Wraps an async function in a request context. * All events logged within fn() are aggregated and finalized when fn() completes. */ runWithContext(path: string, method: string, initialMetadata: Record, fn: () => Promise): Promise; /** * Returns true if there is an active aggregation context. */ hasContext(): boolean; /** * Sets response metadata on the current context (called by TraceMiddleware). */ setResponseMetadata(statusCode: number, responseSize?: number): void; /** * Adds an event to the current request context. */ addEvent(event: Omit): void; info(operation: string, message: string, context?: Record): void; error(operation: string, message: string, context?: Record): void; warn(operation: string, message: string, context?: Record): void; debug(operation: string, message: string, context?: Record): void; audit(operation: string, message: string, context?: Record): void; /** * Finalizes the current context: transforms events, calculates duration, * escalates level, and writes to the logger repository. */ private finalizeContext; /** * Level escalation: the outer log level equals the highest-severity inner event. */ private escalateLevel; /** * Routes the aggregated log to the correct repository method based on level. */ private writeLog; } //# sourceMappingURL=logger-aggregator.d.ts.map