UNPKG

@casoon/auditmysite

Version:

Professional website analysis suite with robust accessibility testing, Core Web Vitals performance monitoring, SEO analysis, and content optimization insights. Features isolated browser contexts, retry mechanisms, and comprehensive API endpoints for profe

134 lines 3.75 kB
/** * Central Logger for AuditMySite * * Provides structured logging with different levels: * - ERROR: Critical errors that need immediate attention * - WARN: Warnings and fallbacks that indicate potential issues * - INFO: General information about the audit process * - SUCCESS: Successful completion of operations * - DEBUG: Detailed debugging information (only in verbose mode) * * Features: * - Clean, consistent output formatting * - Configurable verbosity levels * - Progress tracking without progress bars * - Structured fallback reporting */ export declare enum LogLevel { ERROR = 0, WARN = 1, INFO = 2, SUCCESS = 3, DEBUG = 4 } export interface LoggerOptions { level: LogLevel; verbose: boolean; prefix?: string; enableColors?: boolean; } export interface ProgressTracker { total: number; completed: number; failed: number; current?: string; startTime: Date; } export declare class Logger { private options; private progress; constructor(options?: Partial<LoggerOptions>); /** * Set the verbosity level */ setVerbose(verbose: boolean): void; /** * Log an error (always shown) */ error(message: string, details?: any): void; /** * Log a warning (always shown) */ warn(message: string, details?: any): void; /** * Log a fallback warning (always shown, special formatting) */ fallback(component: string, reason: string, alternative: string, details?: any): void; /** * Log general information */ info(message: string, details?: any): void; /** * Log success messages */ success(message: string, details?: any): void; /** * Log debug information (only in verbose mode) */ debug(message: string, details?: any): void; /** * Start progress tracking */ startProgress(total: number, description?: string): void; /** * Update progress (replaces progress bars) */ updateProgress(completed: number, failed?: number, current?: string): void; /** * Complete progress tracking */ completeProgress(): void; /** * Log a section header */ section(title: string): void; /** * Log analysis results summary */ results(stats: { tested: number; passed: number; failed: number; errors: number; warnings: number; successRate: number; }): void; /** * Log configuration information */ config(config: Record<string, any>): void; /** * Log generated files */ files(files: string[]): void; /** * Core logging method */ private log; /** * Check if we should log at this level */ private shouldLog; /** * Create a child logger with a prefix */ child(prefix: string): Logger; } export declare const logger: Logger; export declare const log: { error: (message: string, details?: any) => void; warn: (message: string, details?: any) => void; fallback: (component: string, reason: string, alternative: string, details?: any) => void; info: (message: string, details?: any) => void; success: (message: string, details?: any) => void; debug: (message: string, details?: any) => void; section: (title: string) => void; results: (stats: any) => void; config: (config: Record<string, any>) => void; files: (files: string[]) => void; setVerbose: (verbose: boolean) => void; startProgress: (total: number, description?: string) => void; updateProgress: (completed: number, failed?: number, current?: string) => void; completeProgress: () => void; }; //# sourceMappingURL=logger.d.ts.map