From 7606d244e876452181945b2d3e66ba80e25fc18a Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 3 Aug 2022 03:21:43 +0800 Subject: [PATCH] tweak debug output levels --- services/net/src/std_glue.rs | 2 +- services/net/src/std_tcplistener.rs | 8 ++++---- services/net/src/std_tcpstream.rs | 9 +++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/services/net/src/std_glue.rs b/services/net/src/std_glue.rs index 41ce14d71..b81516332 100644 --- a/services/net/src/std_glue.rs +++ b/services/net/src/std_glue.rs @@ -87,7 +87,7 @@ pub(crate) fn respond_with_connected( let body = env.body.memory_message_mut().unwrap(); let bfr = body.buf.as_slice_mut::(); - log::trace!("successfully connected: {}", idx); + log::debug!("successfully connected: {}", idx); bfr[0] = 0; bfr[1] = idx; bfr[2] = local_port; diff --git a/services/net/src/std_tcplistener.rs b/services/net/src/std_tcplistener.rs index a76dae3e1..a9e5723b6 100644 --- a/services/net/src/std_tcplistener.rs +++ b/services/net/src/std_tcplistener.rs @@ -48,7 +48,7 @@ pub(crate) fn std_tcp_listen( _ => NetError::LibraryError, }) { - log::trace!("couldn't listen: {:?}", e); + log::debug!("couldn't listen: {:?}", e); std_failure(msg, e); return; } @@ -58,7 +58,7 @@ pub(crate) fn std_tcp_listen( let body = msg.body.memory_message_mut().unwrap(); let bfr = body.buf.as_slice_mut::(); - log::trace!("successfully connected: {} -> {:?}:{}", fd, address, local_port); + log::debug!("successfully connected: {} -> {:?}:{}", fd, address, local_port); bfr[0] = 0; bfr[1] = fd; } @@ -95,7 +95,7 @@ pub(crate) fn std_tcp_accept( let socket = iface.get_socket::(*handle); if socket.is_active() { - log::trace!("accept did not block; immediately returning TcpSocket"); + log::debug!("accept did not block; immediately returning TcpSocket"); let buf = body.buf.as_slice_mut::(); tcp_accept_success(buf, fd as u16, socket.remote_endpoint()); return; @@ -105,7 +105,7 @@ pub(crate) fn std_tcp_accept( std_failure(msg, NetError::WouldBlock); return; } - log::trace!("TCP listener added to accept queue"); + log::debug!("TCP listener added to accept queue"); // Adding the message to the udp_rx_waiting list prevents it from going out of scope and // thus prevents the .drop() method from being called. Since messages are returned to the sender diff --git a/services/net/src/std_tcpstream.rs b/services/net/src/std_tcpstream.rs index 21ee80d85..9396472df 100644 --- a/services/net/src/std_tcpstream.rs +++ b/services/net/src/std_tcpstream.rs @@ -57,7 +57,7 @@ pub(crate) fn std_tcp_connect( _ => NetError::LibraryError, }) { - log::trace!("couldn't connect: {:?}", e); + log::debug!("couldn't connect: {:?}", e); respond_with_error(msg, e); return; } @@ -71,6 +71,7 @@ pub(crate) fn std_tcp_connect( tcp_connect_waiting, (msg, handle, idx, local_port, remote_port), ); + log::info!("connect waiting now: {}, {:?} {:?} {:?}", idx, handle, local_port, remote_port); } pub(crate) fn std_tcp_tx( @@ -174,7 +175,7 @@ pub(crate) fn std_tcp_rx( let socket = iface.get_socket::(*handle); if socket.can_recv() { - log::trace!("receiving data right away"); + log::debug!("receiving data right away"); match socket.recv_slice(body.buf.as_slice_mut()) { Ok(bytes) => { // it's actually valid to receive 0 bytes, but the encoding of this field doesn't allow it. @@ -182,7 +183,7 @@ pub(crate) fn std_tcp_rx( // as the "error" when you try to create a NonZeroUsize with 0. body.valid = xous::MemorySize::new(bytes); body.offset = xous::MemoryAddress::new(1); - log::trace!("set body.valid = {:?}", body.valid); + log::debug!("set body.valid = {:?}", body.valid); } Err(e) => { log::error!("unable to receive: {:?}", e); @@ -192,7 +193,7 @@ pub(crate) fn std_tcp_rx( return; } - log::trace!("socket was not able to receive, adding it to list of waiting messages"); + log::debug!("socket was not able to receive, adding it to list of waiting messages"); // Add the message to the TcpRxWaiting list, which will prevent it from getting // responded to right away.