/** * Logger interfaces and implementations * * Why: Replaces console.error with structured, level-based logging. * Enables production-ready logging with context and proper error handling. * * Security: Profile-aware token redaction prevents sensitive data leakage. */ import type { AuthInterceptor } from '../types/profile.js'; /** * Sanitize log message to prevent log injection * Strips ANSI codes and escapes control characters */ export declare function sanitizeLogMessage(message: string): string; export declare enum LogLevel { DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3, SILENT = 4 } export interface Logger { debug(message: string, context?: Record): void; info(message: string, context?: Record): void; warn(message: string, context?: Record): void; error(message: string, error?: Error, context?: Record): void; } /** * Default logger - writes to stderr, respects MCP4_LOG_LEVEL env var * * Security: Redacts auth tokens based on profile configuration */ export declare class ConsoleLogger implements Logger { private level; private authConfig?; constructor(level?: LogLevel, authConfig?: AuthInterceptor); debug(message: string, context?: Record): void; info(message: string, context?: Record): void; warn(message: string, context?: Record): void; error(message: string, error?: Error, context?: Record): void; private write; } /** * Structured JSON logger for production * * Why: Machine-readable logs for log aggregation systems (ELK, Splunk, etc.) * Security: Redacts auth tokens based on profile configuration */ export declare class JsonLogger implements Logger { private level; private authConfig?; constructor(level?: LogLevel, authConfig?: AuthInterceptor); debug(message: string, context?: Record): void; info(message: string, context?: Record): void; warn(message: string, context?: Record): void; error(message: string, error?: Error, context?: Record): void; private write; } //# sourceMappingURL=logger.d.ts.map