mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-24 01:38:45 +00:00
fix(core): remove calls to log on non-debug builds
This commit is contained in:
parent
a4e9a74988
commit
0b7221aa45
@ -183,12 +183,13 @@ class Channel:
|
|||||||
return received_message_handler.handle_received_message(self, buffer)
|
return received_message_handler.handle_received_message(self, buffer)
|
||||||
elif self.expected_payload_length + INIT_HEADER_LENGTH > self.bytes_read:
|
elif self.expected_payload_length + INIT_HEADER_LENGTH > self.bytes_read:
|
||||||
self.is_cont_packet_expected = True
|
self.is_cont_packet_expected = True
|
||||||
self._log(
|
if __debug__ and utils.ALLOW_DEBUG_MESSAGES:
|
||||||
"CONT EXPECTED - read/expected:",
|
self._log(
|
||||||
str(self.bytes_read)
|
"CONT EXPECTED - read/expected:",
|
||||||
+ "/"
|
str(self.bytes_read)
|
||||||
+ str(self.expected_payload_length + INIT_HEADER_LENGTH),
|
+ "/"
|
||||||
)
|
+ str(self.expected_payload_length + INIT_HEADER_LENGTH),
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
raise ThpError(
|
raise ThpError(
|
||||||
"Read more bytes than is the expected length of the message!"
|
"Read more bytes than is the expected length of the message!"
|
||||||
@ -238,7 +239,8 @@ class Channel:
|
|||||||
raise Exception(
|
raise Exception(
|
||||||
"Channel is in a state that does not support fallback."
|
"Channel is in a state that does not support fallback."
|
||||||
)
|
)
|
||||||
self._log("Started fallback read")
|
if __debug__ and utils.ALLOW_DEBUG_MESSAGES:
|
||||||
|
self._log("Started fallback read")
|
||||||
self._prepare_fallback()
|
self._prepare_fallback()
|
||||||
except Exception:
|
except Exception:
|
||||||
self.fallback_decrypt = False
|
self.fallback_decrypt = False
|
||||||
@ -385,7 +387,8 @@ class Channel:
|
|||||||
def _finish_fallback(self) -> None:
|
def _finish_fallback(self) -> None:
|
||||||
self.fallback_decrypt = False
|
self.fallback_decrypt = False
|
||||||
self.busy_decoder = None
|
self.busy_decoder = None
|
||||||
self._log("Finish fallback")
|
if __debug__ and utils.ALLOW_DEBUG_MESSAGES:
|
||||||
|
self._log("Finish fallback")
|
||||||
|
|
||||||
def _decrypt_single_packet_payload(
|
def _decrypt_single_packet_payload(
|
||||||
self, payload: utils.BufferType
|
self, payload: utils.BufferType
|
||||||
|
Loading…
Reference in New Issue
Block a user