Move options to log level out of shell.py
Move the conversion of command line options to log level out of shell.py. Change-Id: I86cb45a85cd63927aa1c87c1eed27542981df659 Implements: blueprint logging-migration
This commit is contained in:
parent
8c0a6b8122
commit
825f9ada43
@ -113,18 +113,7 @@ class OpenStackShell(app.App):
|
||||
super(OpenStackShell, self).configure_logging()
|
||||
|
||||
# Set logging to the requested level
|
||||
if self.options.verbose_level == 0:
|
||||
# --quiet
|
||||
log_level = logging.ERROR
|
||||
elif self.options.verbose_level == 1:
|
||||
# This is the default case, no --debug, --verbose or --quiet
|
||||
log_level = logging.WARNING
|
||||
elif self.options.verbose_level == 2:
|
||||
# One --verbose
|
||||
log_level = logging.INFO
|
||||
elif self.options.verbose_level >= 3:
|
||||
# Two or more --verbose
|
||||
log_level = logging.DEBUG
|
||||
log_level = context.log_level_from_options(self.options)
|
||||
context.set_warning_filter(log_level)
|
||||
|
||||
# Set the handler logging level of FileHandler(--log-file)
|
||||
|
Loading…
Reference in New Issue
Block a user