From 667d6beb9648a6861e1739343ed1f3594d3693ea Mon Sep 17 00:00:00 2001 From: nomdetom Date: Thu, 5 Feb 2026 03:42:36 +0000 Subject: [PATCH] Refactor logging in ProtobufModule to ensure message details are logged after successful decoding --- src/mesh/ProtobufModule.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh/ProtobufModule.h b/src/mesh/ProtobufModule.h index 725477eaeea..27e653efe2a 100644 --- a/src/mesh/ProtobufModule.h +++ b/src/mesh/ProtobufModule.h @@ -82,7 +82,6 @@ template class ProtobufModule : protected SinglePortModule // it would be better to update even if the message was destined to others. auto &p = mp.decoded; - LOG_INFO("Received %s from=0x%0x, id=0x%x, portnum=%d, payloadlen=%d", name, mp.from, mp.id, p.portnum, p.payload.size); T scratch; T *decoded = NULL; @@ -90,6 +89,8 @@ template class ProtobufModule : protected SinglePortModule memset(&scratch, 0, sizeof(scratch)); if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, fields, &scratch)) { decoded = &scratch; + LOG_INFO("Received %s from=0x%0x, id=0x%x, portnum=%d, payloadlen=%d", name, mp.from, mp.id, p.portnum, + p.payload.size); } else { LOG_ERROR("Error decoding proto module!"); // if we can't decode it, nobody can process it!