/** * Structured logging utility for the Frihet MCP server. * * Outputs JSON to stderr (MCP protocol uses stdout for messages). * Works in both Node.js (stdio) and Cloudflare Workers (fetch handler) environments. * * Set FRIHET_MCP_DEBUG=1 to enable debug-level logs. */ export interface LogEntry { level: "debug" | "info" | "warn" | "error"; message: string; service: "frihet-mcp"; timestamp: string; tool?: string; operation?: string; durationMs?: number; error?: { message: string; code?: string; statusCode?: number; }; metadata?: Record; } type LogInput = Omit; /** * Emit a structured log entry as JSON to stderr. * In Cloudflare Workers, console.error automatically routes to Workers Logs. */ export declare function log(entry: LogInput): void; /** * Log the result of a tool call with timing. */ export declare function logToolCall(tool: string, startTime: number, success: boolean, error?: Error & { statusCode?: number; errorCode?: string; }): void; /** * Log an outbound API call with timing. */ export declare function logApiCall(method: string, _path: string, statusCode: number, durationMs: number): void; /** * Log a rate-limit retry. */ export declare function logRetry(method: string, _path: string, retryCount: number, delayMs: number): void; export {}; //# sourceMappingURL=logger.d.ts.map