1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

chore(core): improve logging of "write message"

This commit is contained in:
M1nd3r 2024-07-24 09:41:59 +02:00
parent ab0f89ee18
commit a5fd09d230

View File

@ -242,8 +242,14 @@ class Channel:
# CALLED BY WORKFLOW / SESSION CONTEXT
async def write(self, msg: protobuf.MessageType, session_id: int = 0) -> None:
if __debug__:
log.debug(__name__, "write message: %s", msg.MESSAGE_NAME)
if __debug__ and utils.EMULATOR:
log.debug(
__name__,
"write message: %s\n%s",
msg.MESSAGE_NAME,
utils.dump_protobuf(msg),
)
self.buffer = memory_manager.get_write_buffer(self.buffer, msg)
noise_payload_len = memory_manager.encode_into_buffer(
self.buffer, msg, session_id