mirror of https://github.com/jackwener/wx-cli.git
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
parent
521c6296b6
commit
1106b4f544
|
|
@ -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(())
|
||||
|
|
|
|||
Loading…
Reference in New Issue