feat(daemon): log every received request at info level

Add info!(cmd = ?req, "收到请求") in handle_connection so each
incoming request is logged with its full Request variant for diagnostics.
pull/43/head
David Li 2026-05-13 17:40:40 +08:00
parent 521c6296b6
commit 1106b4f544
1 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,7 @@ use std::net::SocketAddr;
use std::sync::Arc;
use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncWrite, AsyncWriteExt, BufReader};
use anyhow::Result;
use tracing::info;
use crate::daemon::cache::DbCache;
use crate::daemon::query::Names;
@ -81,6 +82,7 @@ where
}
};
info!(cmd = ?req, "收到请求");
let resp = dispatch(req, db, names).await;
writer.write_all(resp.to_json_line()?.as_bytes()).await?;
Ok(())