diff --git a/electrum/logging.py b/electrum/logging.py index 1d3bbb79f..23427b54d 100644 --- 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 index bb6ff8d43..7102725fb 100755 --- 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', }