config: Add -C/--console parameter
This commit is contained in:
parent
f8225bfbc9
commit
4691ba7386
1 changed files with 11 additions and 0 deletions
|
@ -573,6 +573,13 @@ class Config:
|
||||||
help='Show verbose messages'
|
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)
|
self.add_options_to_parser(self.options_parser)
|
||||||
|
|
||||||
return self.options_parser
|
return self.options_parser
|
||||||
|
@ -623,6 +630,10 @@ class Config:
|
||||||
elif options.verbose:
|
elif options.verbose:
|
||||||
logging.getLogger().setLevel(logging.INFO)
|
logging.getLogger().setLevel(logging.INFO)
|
||||||
|
|
||||||
|
if options.console:
|
||||||
|
console_handler = logging.StreamHandler(sys.stdout)
|
||||||
|
logging.getLogger().addHandler(console_handler)
|
||||||
|
|
||||||
self._loaded()
|
self._loaded()
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
Loading…
Reference in a new issue