From 4eb983c58ffadd306d727042ead18707c7214e6d Mon Sep 17 00:00:00 2001 From: YoVinchen Date: Tue, 20 Jan 2026 16:59:27 +0800 Subject: [PATCH] feat(proxy): add request logging for debugging Add debug logs for outgoing requests including URL and body content with byte size, matching the existing response logging format. --- src-tauri/src/proxy/forwarder.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src-tauri/src/proxy/forwarder.rs b/src-tauri/src/proxy/forwarder.rs index f0e934259..9c0a0fc96 100644 --- a/src-tauri/src/proxy/forwarder.rs +++ b/src-tauri/src/proxy/forwarder.rs @@ -664,6 +664,17 @@ impl RequestForwarder { request = request.header("anthropic-version", version_str); } + // 输出请求信息日志 + let tag = adapter.name(); + log::debug!("[{tag}] >>> 请求 URL: {url}"); + if let Ok(body_str) = serde_json::to_string(&filtered_body) { + log::debug!( + "[{tag}] >>> 请求体内容 ({}字节): {}", + body_str.len(), + body_str + ); + } + // 发送请求 let response = request.json(&filtered_body).send().await.map_err(|e| { if e.is_timeout() {