From b0373396888e1b5b9cd814279b58ca62d3c21e4a Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Wed, 12 Sep 2018 16:35:26 +0200 Subject: [PATCH] xmr: lite debug only --- src/apps/monero/lite_protocol.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/apps/monero/lite_protocol.py b/src/apps/monero/lite_protocol.py index f4c9dabba..ec882b02d 100644 --- a/src/apps/monero/lite_protocol.py +++ b/src/apps/monero/lite_protocol.py @@ -18,10 +18,11 @@ async def lite_protocol(ctx, msg, state, is_init=False): from trezor.messages.MoneroLiteAck import MoneroLiteAck - log.debug( - __name__, - "### Lite. Free: {} Allocated: {}".format(gc.mem_free(), gc.mem_alloc()), - ) + if __debug__: + log.debug( + __name__, + "### Lite. Free: {} Allocated: {}".format(gc.mem_free(), gc.mem_alloc()), + ) gc.collect() try: @@ -32,5 +33,6 @@ async def lite_protocol(ctx, msg, state, is_init=False): except Exception as e: state.ctx_ki = None - log.debug(__name__, "Lite error, %s: %s", type(e), e) + if __debug__: + log.debug(__name__, "Lite error, %s: %s", type(e), e) raise