diff --git a/examples/common/tracing/TraceDecoder.cpp b/examples/common/tracing/TraceDecoder.cpp index e076a44f0497b2..eedfd73fb748fd 100644 --- a/examples/common/tracing/TraceDecoder.cpp +++ b/examples/common/tracing/TraceDecoder.cpp @@ -175,9 +175,9 @@ CHIP_ERROR TraceDecoder::MaybeLogAndConsumeEncryptedPayload(Json::Value & json) size_t size = static_cast(json[kPayloadEncryptedSizeKey].asLargestUInt()); if (size) { - auto payload = json[kPayloadEncryptedDataKey].asString(); - auto bufferPtr = json[kPayloadEncryptedBufferPtrKey].asString(); - auto scoppedIndent = ScopedLogIndentWithSize("Encrypted Payload", size); + auto payload = json[kPayloadEncryptedDataKey].asString(); + auto bufferPtr = json[kPayloadEncryptedBufferPtrKey].asString(); + auto scopedIndent = ScopedLogIndentWithSize("Encrypted Payload", size); Log("data", payload.c_str()); Log("buffer_ptr", bufferPtr.c_str()); } @@ -272,6 +272,12 @@ CHIP_ERROR TraceDecoder::MaybeLogAndConsumePayload(Json::Value & json, bool isRe auto size = static_cast(json[kPayloadSizeKey].asLargestUInt()); if (size) { + { + auto payload = json[kPayloadDataKey].asString(); + auto scopedIndent = ScopedLogIndentWithSize("Decrypted Payload", size); + Log("data", payload.c_str()); + } + bool shouldDecode = !isResponse || mOptions.mEnableProtocolInteractionModelResponse; auto payload = json[kPayloadDataKey].asString(); auto protocolId = json[kProtocolIdKey].asLargestUInt();