tweak debug output levels

This commit is contained in:
bunnie 2022-08-03 03:21:43 +08:00
parent 473c95a74c
commit 7606d244e8
3 changed files with 10 additions and 9 deletions

View file

@ -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::<u16>();
log::trace!("successfully connected: {}", idx);
log::debug!("successfully connected: {}", idx);
bfr[0] = 0;
bfr[1] = idx;
bfr[2] = local_port;

View file

@ -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::<u8>();
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::<TcpSocket>(*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::<u8>();
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

View file

@ -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::<TcpSocket>(*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.