From 4691ba7386c81d1bb388d9dd412d2e8041100604 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 18 Nov 2021 19:55:44 +0100 Subject: [PATCH] config: Add -C/--console parameter --- mylib/config.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mylib/config.py b/mylib/config.py index 26f7fb2..172f6f5 100644 --- a/mylib/config.py +++ b/mylib/config.py @@ -573,6 +573,13 @@ class Config: help='Show verbose messages' ) + self.options_parser.add_argument( + '-C', + '--console', + action='store_true', + help='Log on console' + ) + self.add_options_to_parser(self.options_parser) return self.options_parser @@ -623,6 +630,10 @@ class Config: elif options.verbose: logging.getLogger().setLevel(logging.INFO) + if options.console: + console_handler = logging.StreamHandler(sys.stdout) + logging.getLogger().addHandler(console_handler) + self._loaded() return options