logging: don't log to file by default

Leaking addresses/pubkeys/txids is a privacy leak...
but with lightning, logging should be enabled by default, as otherwise
issues would be sometimes impossible to debug...
Well, disable it for now.
This commit is contained in:
SomberNight 2019-05-08 16:52:04 +02:00
parent 3ed502a728
commit f6a7e6ec7d
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
3 changed files with 3 additions and 4 deletions

View file

@ -942,7 +942,6 @@ 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=None, help="Do not log to file")
def get_parser():
# create main parser

View file

@ -3011,9 +3011,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
gui_widgets.append((updatecheck_cb, None))
filelogging_cb = QCheckBox(_("Write logs to file"))
filelogging_cb.setChecked(not self.config.get('disablefilelogging', False))
filelogging_cb.setChecked(bool(self.config.get('log_to_file', False)))
def on_set_filelogging(v):
self.config.set_key('disablefilelogging', v == Qt.Unchecked, save=True)
self.config.set_key('log_to_file', v == Qt.Checked, 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))

View file

@ -233,7 +233,7 @@ def configure_logging(config):
_configure_verbosity(verbosity=verbosity, verbosity_shortcuts=verbosity_shortcuts)
is_android = 'ANDROID_DATA' in os.environ
if is_android or config.get('disablefilelogging'):
if is_android or not config.get('log_to_file', False):
pass # disable file logging
else:
log_directory = pathlib.Path(config.path) / "logs"