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:
TerryHowe 2015-08-09 07:01:18 -06:00
parent 8c0a6b8122
commit 825f9ada43

View File

@ -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)