Skip to content

Commit

Permalink
Ascii-fy the command string in message header trace
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence authored and dconnolly committed Oct 17, 2019
1 parent 17b9352 commit 0a56830
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zebra-network/src/protocol/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,14 @@ impl Decoder for Codec {
let command = header_reader.read_12_bytes()?;
let body_len = header_reader.read_u32::<LittleEndian>()? as usize;
let checksum = Sha256dChecksum(header_reader.read_4_bytes()?);
trace!(?self.state, ?magic, ?command, body_len, ?checksum, "read header from src buffer");
trace!(
?self.state,
?magic,
command = %String::from_utf8_lossy(&command),
body_len,
?checksum,
"read header from src buffer"
);

if magic != self.builder.network.magic() {
return Err(Parse("supplied magic did not meet expectations"));
Expand Down

0 comments on commit 0a56830

Please sign in to comment.