From 0f541be6f11a372d202c99476e6d051184006bba Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 31 Mar 2023 13:03:26 +0000 Subject: [PATCH] log a warning if asserts are disabled Maybe we should refuse to start, if launched with the main script. But note that __debug__ is False on Android atm, as python is launched with -OO. --- electrum/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/electrum/__init__.py b/electrum/__init__.py index cea6ac59b..f806c548b 100644 --- a/electrum/__init__.py +++ b/electrum/__init__.py @@ -29,6 +29,11 @@ from . import daemon from .transaction import Transaction from .plugin import BasePlugin from .commands import Commands, known_commands +from .logging import get_logger __version__ = ELECTRUM_VERSION + +_logger = get_logger(__name__) +if not __debug__: + _logger.warning(f"__debug__ is False. running with asserts disabled!")