From 28904e01c794cc018617f5ac8c072245db68e35d Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Tue, 24 Sep 2019 16:14:50 -0700 Subject: [PATCH] Trace the decoded message in the decoder. --- zebra-network/src/protocol/codec.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zebra-network/src/protocol/codec.rs b/zebra-network/src/protocol/codec.rs index 5feb693ab..87e57824c 100644 --- a/zebra-network/src/protocol/codec.rs +++ b/zebra-network/src/protocol/codec.rs @@ -308,8 +308,12 @@ impl Decoder for Codec { b"merkleblock\0" => self.read_merkleblock(body_reader), _ => bail!("unknown command"), } - // We need Ok(Some(msg)) to signal that we're done decoding - .map(|msg| Some(msg)) + // We need Ok(Some(msg)) to signal that we're done decoding. + // This is also convenient for tracing the parse result. + .map(|msg| { + trace!(?msg); + Some(msg) + }) } } }