Skip to content

Commit

Permalink
Feature gate trace! for received packets.
Browse files Browse the repository at this point in the history
  • Loading branch information
gz committed Sep 24, 2021
1 parent 5e21643 commit 9e060d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/protocol/recv_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl RecvPacketStateMachine {
}

if matches!(self.state, State::Ready) {
#[cfg(feature = "trace-pkt")]
trace!(
"<-- {}",
core::str::from_utf8(buf.as_slice()).unwrap_or("<invalid packet>")
Expand Down Expand Up @@ -111,6 +112,7 @@ impl RecvPacketBlocking {
buf.push(get_byte().map_err(RecvPacketError::Connection)?)?;
}

#[cfg(feature = "trace-pkt")]
trace!(
"<-- {}",
core::str::from_utf8(buf.as_slice()).unwrap_or("<invalid packet>")
Expand Down

0 comments on commit 9e060d2

Please sign in to comment.