/** * Structured logging utility for MCP server * * IMPORTANT: MCP servers use stdio for communication, so all logging MUST go to stderr * (console.error) to avoid interfering with the MCP protocol on stdout. */ export declare enum LogLevel { DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3 } export declare class Logger { private level; private context?; constructor(level?: LogLevel, context?: string); /** * Create a child logger with a specific context */ child(context: string): Logger; /** * Set the logging level */ setLevel(level: LogLevel): void; /** * The level currently in force. Used by the startup log line so it reports the * effective level rather than the raw environment string. */ getLevel(): LogLevel; /** * Internal logging method */ private log; /** * Log debug message (detailed information for diagnosing problems) */ debug(message: string, metadata?: Record): void; /** * Log info message (general informational messages) */ info(message: string, metadata?: Record): void; /** * Log warning message (warning messages for potentially harmful situations) */ warn(message: string, metadata?: Record): void; /** * Log error message (error events that might still allow the application to continue) */ error(message: string, error?: Error, metadata?: Record): void; /** * Log API request */ logApiRequest(service: string, endpoint: string, metadata?: Record): void; /** * Log API response */ logApiResponse(service: string, endpoint: string, success: boolean, duration?: number): void; /** * Log cache operation */ logCacheOperation(operation: 'hit' | 'miss' | 'set' | 'evict', key: string): void; } /** * Resolve a raw LOG_LEVEL value to a level. Accepts `0`-`3` and the four names, * case- and whitespace-insensitively. Anything else warns on stderr and falls * back to INFO. Exported for reuse by the tests: pure, no I/O beyond the warning, * no environment read. */ export declare function parseLogLevel(raw: string | undefined): LogLevel; export declare const logger: Logger; /** * Round coordinates for logging to protect user privacy * Reduces precision to ~1.1km accuracy (2 decimal places) * Set LOG_PII=true environment variable to log full precision (not recommended for production) * * Privacy rationale: Precise coordinates can reveal sensitive locations (homes, workplaces). * Rounded coordinates provide sufficient context for debugging while protecting user privacy. * * @param latitude - Original latitude * @param longitude - Original longitude * @returns Rounded coordinates object */ export declare function redactCoordinatesForLogging(latitude: number, longitude: number): { lat: number; lon: number; }; //# sourceMappingURL=logger.d.ts.map