/** * Logger for Chaos Crawler * * Writes structured logs to file and/or console during execution. */ import type { PageResult, PageError, ActionResult, RecoveryInfo } from "./types.js"; export type LogLevel = "debug" | "info" | "warn" | "error"; export interface LogEntry { timestamp: string; level: LogLevel; event: string; data?: Record; } export interface LoggerOptions { /** Path to log file (if not set, no file logging) */ logFile?: string; /** Minimum log level to write */ level?: LogLevel; /** Also write to console */ console?: boolean; /** Use JSON format for file output */ jsonFormat?: boolean; } export declare class Logger { private options; private stream; private buffer; constructor(options?: LoggerOptions); private initFileStream; private shouldLog; private formatEntry; private write; debug(event: string, data?: Record): void; info(event: string, data?: Record): void; warn(event: string, data?: Record): void; error(event: string, data?: Record): void; logCrawlStart(baseUrl: string, options: Record): void; logCrawlEnd(summary: Record): void; logPageStart(url: string): void; logPageComplete(result: PageResult): void; logPageError(error: PageError): void; logAction(action: ActionResult): void; logBlockedNavigation(url: string): void; logProgress(visited: number, total: number): void; logRecovery(recovery: RecoveryInfo): void; logNavigationError(url: string, statusCode: number, error: string): void; getEntries(): LogEntry[]; close(): Promise; } /** * Create a no-op logger for when logging is disabled */ export declare function createNullLogger(): Logger; //# sourceMappingURL=logger.d.ts.map