electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 625f985f22a6b09bb106159b400843df491a3833
parent fcbc1c9a459d79d54d6c102912f56b922d58fb19
Author: SomberNight <somber.night@protonmail.com>
Date:   Fri, 19 Jun 2020 01:52:21 +0200

android: enable full logging if DEBUG build

Diffstat:
Melectrum/logging.py | 9++++++---
Mrun_electrum | 4+++-
2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/electrum/logging.py b/electrum/logging.py @@ -232,10 +232,13 @@ def configure_logging(config): verbosity_shortcuts = config.get('verbosity_shortcuts') _configure_verbosity(verbosity=verbosity, verbosity_shortcuts=verbosity_shortcuts) + log_to_file = config.get('log_to_file', False) is_android = 'ANDROID_DATA' in os.environ - if is_android or not config.get('log_to_file', False): - pass # disable file logging - else: + if is_android: + from jnius import autoclass + build_config = autoclass("org.electrum.electrum.BuildConfig") + log_to_file |= bool(build_config.DEBUG) + if log_to_file: log_directory = pathlib.Path(config.path) / "logs" _configure_file_logging(log_directory) diff --git a/run_electrum b/run_electrum @@ -307,8 +307,10 @@ if __name__ == '__main__': # config is an object passed to the various constructors (wallet, interface, gui) if is_android: + from jnius import autoclass + build_config = autoclass("org.electrum.electrum.BuildConfig") config_options = { - 'verbosity': '', + 'verbosity': '*' if build_config.DEBUG else '', 'cmd': 'gui', 'gui': 'kivy', }