diff --git a/core/src/trezor/wire/__init__.py b/core/src/trezor/wire/__init__.py index 7462048ba9..b826ee0949 100644 --- a/core/src/trezor/wire/__init__.py +++ b/core/src/trezor/wire/__init__.py @@ -281,12 +281,16 @@ async def handle_session(iface: WireInterface, session_id: int) -> None: await req_reader.aopen() if __debug__: + try: + msg_type = messages.get_type(req_reader.type).__name__ + except KeyError: + msg_type = "%d - unknown message type" % req_reader.type log.debug( __name__, - "%s:%x receive: %s", + "%s:%x receive: <%s>", iface.iface_num(), session_id, - messages.get_type(req_reader.type), + msg_type, ) else: # We have a reader left over from earlier. We should process