From d845d0117ab9418fa8f2c5e18de10a3276a03b3f Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Mon, 24 Mar 2025 12:36:11 +0100 Subject: [PATCH] chore: improve logging in received_message_handler --- core/src/trezor/wire/thp/received_message_handler.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/trezor/wire/thp/received_message_handler.py b/core/src/trezor/wire/thp/received_message_handler.py index 275e4c3912..8dfae7fca6 100644 --- a/core/src/trezor/wire/thp/received_message_handler.py +++ b/core/src/trezor/wire/thp/received_message_handler.py @@ -152,8 +152,8 @@ def _send_ack(ctx: Channel, ack_bit: int) -> Awaitable[None]: if __debug__ and utils.ALLOW_DEBUG_MESSAGES: log.debug( __name__, - "Writing ACK message to a channel with id: %d, ack_bit: %d", - ctx.get_channel_id_int(), + "Writing ACK message to a channel with cid: %s, ack_bit: %d", + get_bytes_as_str(ctx.channel_id), ack_bit, ) return write_payload_to_wire_and_add_checksum(ctx.iface, header, b"") @@ -404,6 +404,11 @@ async def _handle_state_ENCRYPTED_TRANSPORT(ctx: Channel, message_length: int) - ], ) ) + if __debug__ and utils.ALLOW_DEBUG_MESSAGES: + log.debug( + __name__, + f"Scheduled message to be handled by a session (session_id: {session_id}, msg_type (int): {message_type})", + ) async def _handle_pairing(ctx: Channel, message_length: int) -> None: