diff --git a/lbry/lbry/extras/cli.py b/lbry/lbry/extras/cli.py index 46586af02..88295b676 100644 --- a/lbry/lbry/extras/cli.py +++ b/lbry/lbry/extras/cli.py @@ -187,6 +187,10 @@ def get_argument_parser(): '--quiet', dest='quiet', action="store_true", help='Disable all console output.' ) + start.add_argument( + '--no-logging', dest='no_logging', action="store_true", + help='Disable all logging of any kind.' + ) start.add_argument( '--verbose', nargs="*", help=('Enable debug output for lbry logger and event loop. Optionally specify loggers for which debug output ' @@ -261,7 +265,8 @@ def run_daemon(args: argparse.Namespace, conf: Config): loop = asyncio.get_event_loop() if args.verbose is not None: loop.set_debug(True) - setup_logging(logging.getLogger(), args, conf) + if not args.no_logging: + setup_logging(logging.getLogger(), args, conf) daemon = Daemon(conf) def __exit(): diff --git a/lbry/tests/unit/test_cli.py b/lbry/tests/unit/test_cli.py index a50ee1650..7f79c2dfb 100644 --- a/lbry/tests/unit/test_cli.py +++ b/lbry/tests/unit/test_cli.py @@ -200,7 +200,7 @@ class CLITest(AsyncioTestCase): raise KeyboardInterrupt mock_daemon_start.side_effect = side_effect - self.shell(["start"]) + self.shell(["start", "--no-logging"]) mock_daemon_start.assert_called_once()