From 825f9ada436c341aa779eef59a9012b422671bce Mon Sep 17 00:00:00 2001 From: TerryHowe Date: Sun, 9 Aug 2015 07:01:18 -0600 Subject: [PATCH] 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 --- openstackclient/shell.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 58eb9f5..6ba19d1 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -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)