/** * Logger Service * * Configurable logging system for the SDK * Allows merchants to control log output and integrate with their own logging systems */ export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none'; export interface LogEntry { level: LogLevel; message: string; timestamp: number; data?: unknown; context?: string; } export interface LoggerConfig { /** * Minimum log level to output * - 'debug': All logs * - 'info': Info, warn, error * - 'warn': Warn and error only * - 'error': Error only * - 'none': No logs */ level: LogLevel; /** * Custom log handler * If provided, logs will be sent here instead of console */ onLog?: (entry: LogEntry) => void; /** * Whether to include timestamps in console output */ showTimestamp?: boolean; /** * Context prefix for all logs (e.g., widget instance ID) */ context?: string; } export declare class Logger { private config; private static readonly LOG_LEVELS; private static readonly LEVEL_COLORS; private static readonly RESET_COLOR; constructor(config: LoggerConfig); /** * Log debug message (verbose details) */ debug(message: string, data?: unknown): void; /** * Log info message (general information) */ info(message: string, data?: unknown): void; /** * Log warning message (potential issues) */ warn(message: string, data?: unknown): void; /** * Log error message (errors and failures) */ error(message: string, data?: unknown): void; /** * Core logging method */ private log; /** * Check if log level should be output */ private shouldLog; /** * Output to console with formatting */ private logToConsole; /** * Create a child logger with additional context */ child(context: string): Logger; /** * Update logger configuration */ setLevel(level: LogLevel): void; } /** * Create a default logger (production-safe: level 'none') */ export declare function createDefaultLogger(config?: Partial): Logger; /** * Create a development logger (verbose) */ export declare function createDevLogger(config?: Partial): Logger; //# sourceMappingURL=logger.service.d.ts.map