增加日志

This commit is contained in:
lubeilin
2023-09-22 22:43:23 +08:00
parent 3766b2b7c1
commit 56fcbd64ed
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ pub enum CommandEnum {
pub fn command(cmd: CommandEnum) {
if let Err(e) = command_(cmd) {
println!("cmd: {}", e);
println!("cmd: {:?}", e);
}
}
+1
View File
@@ -26,6 +26,7 @@ impl CommandServer {
let (len, addr) = udp.recv_from(&mut buf).await?;
match std::str::from_utf8(&buf[..len]) {
Ok(cmd) => {
log::info!("收到cmd={:?}", cmd);
if let Ok(out) = command(cmd, &vnt) {
if let Err(e) = udp.send_to(out.as_bytes(), addr).await {
log::warn!("cmd={},err={:?}", cmd, e);