/** * Logger utility for NCP * * Controls logging based on context: * - When running as MCP server: minimal/no logging to stderr * - When running as CLI or debugging: full logging * - When debug enabled (NCP_DEBUG=true): file-based logging */ export declare class Logger { private static instance; private isMCPMode; private isCLIMode; private debugMode; private logFilePath; private logCallback; private constructor(); /** * Set up file-based logging to avoid console spam in Claude Desktop * Keeps last N log files (configurable via settings), deletes older ones */ private setupFileLogging; /** * Rotate log files - keep last N files, delete older ones */ private rotateLogFiles; /** * Write message to log file (async, non-blocking) * Fire-and-forget pattern - don't await to avoid blocking */ private writeToFile; /** * Format log message with timestamp */ private formatLogMessage; /** * MCP 2025-11-25: Register a callback for log notifications * Used to send debug logs to MCP clients (Claude Desktop, Cursor, etc.) */ setLogCallback(callback: (level: string, message: string) => void): void; /** * Remove the log callback */ clearLogCallback(): void; static getInstance(): Logger; /** * Log informational messages * Completely suppressed in MCP mode and CLI mode unless debugging */ info(message: string): void; /** * Log only essential startup messages in MCP mode */ mcpInfo(message: string): void; /** * Log debug messages * Only shown in debug mode */ debug(message: string): void; /** * Log error messages * Always shown (but minimal in MCP mode) */ error(message: string, error?: any): void; /** * Log warnings * Completely suppressed in MCP mode and CLI mode unless debugging */ warn(message: string): void; /** * Log progress updates * Completely suppressed in MCP mode and CLI mode unless debugging */ progress(message: string): void; /** * Get current log file path (for debugging) */ getLogFilePath(): string | null; /** * Check if in MCP mode */ isInMCPMode(): boolean; /** * Force enable/disable MCP mode */ setMCPMode(enabled: boolean): void; } export declare const logger: Logger; //# sourceMappingURL=logger.d.ts.map