commit c80c3596a7e704f6b445adb36b3b7d2d038bf72a
parent e361a8549c1d9686727f0e6f4994843084104023
Author: SomberNight <somber.night@protonmail.com>
Date: Sat, 4 May 2019 18:30:26 +0200
logging: expose 'disablefilelogging' option in Qt preferences
Diffstat:
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/electrum/commands.py b/electrum/commands.py
@@ -941,7 +941,7 @@ def add_global_options(parser):
group.add_argument("--testnet", action="store_true", dest="testnet", default=False, help="Use Testnet")
group.add_argument("--regtest", action="store_true", dest="regtest", default=False, help="Use Regtest")
group.add_argument("--simnet", action="store_true", dest="simnet", default=False, help="Use Simnet")
- group.add_argument("--disablefilelogging", action="store_true", dest="disablefilelogging", default=False, help="Do not log to file")
+ group.add_argument("--disablefilelogging", action="store_true", dest="disablefilelogging", default=None, help="Do not log to file")
def get_parser():
# create main parser
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
@@ -3005,6 +3005,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
updatecheck_cb.stateChanged.connect(on_set_updatecheck)
gui_widgets.append((updatecheck_cb, None))
+ filelogging_cb = QCheckBox(_("Write logs to file"))
+ filelogging_cb.setChecked(not self.config.get('disablefilelogging', False))
+ def on_set_filelogging(v):
+ self.config.set_key('disablefilelogging', v == Qt.Unchecked, save=True)
+ filelogging_cb.stateChanged.connect(on_set_filelogging)
+ filelogging_cb.setToolTip(_('Debug logs can be persisted to disk. These are useful for troubleshooting.'))
+ gui_widgets.append((filelogging_cb, None))
+
usechange_cb = QCheckBox(_('Use change addresses'))
usechange_cb.setChecked(self.wallet.use_change)
if not self.config.is_modifiable('use_change'): usechange_cb.setEnabled(False)