增加日志
This commit is contained in:
@@ -17,7 +17,7 @@ pub enum CommandEnum {
|
||||
|
||||
pub fn command(cmd: CommandEnum) {
|
||||
if let Err(e) = command_(cmd) {
|
||||
println!("cmd: {}", e);
|
||||
println!("cmd: {:?}", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user