summaryrefslogtreecommitdiff
path: root/openstackclient/shell.py
diff options
context:
space:
mode:
authorTerryHowe <terrylhowe@gmail.com>2015-08-09 06:26:56 -0600
committerTerryHowe <terrylhowe@gmail.com>2015-08-13 16:05:01 -0600
commit9c3c33639139ab319ca6d00925b34f9293ca81af (patch)
treef6474101c16988ee9e5a0c3c9e38dcc64f0bc0f8 /openstackclient/shell.py
parente23dd6de5854fcc8ff76fe1b51eb46162770d9cc (diff)
downloadpython-openstackclient-9c3c33639139ab319ca6d00925b34f9293ca81af.tar.gz
Move set warnings filters to logging module
This is the first step in moving logging out of shell.py Change-Id: I3dcb4e17bb4687988ddf9b793ad1a308ef89b242 Implements: blueprint logging-migration
Diffstat (limited to 'openstackclient/shell.py')
-rw-r--r--openstackclient/shell.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 7cef51ba..58eb9f54 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -20,7 +20,6 @@ import getpass
import logging
import sys
import traceback
-import warnings
from cliff import app
from cliff import command
@@ -117,18 +116,16 @@ class OpenStackShell(app.App):
if self.options.verbose_level == 0:
# --quiet
log_level = logging.ERROR
- warnings.simplefilter("ignore")
elif self.options.verbose_level == 1:
# This is the default case, no --debug, --verbose or --quiet
log_level = logging.WARNING
- warnings.simplefilter("ignore")
elif self.options.verbose_level == 2:
# One --verbose
log_level = logging.INFO
- warnings.simplefilter("once")
elif self.options.verbose_level >= 3:
# Two or more --verbose
log_level = logging.DEBUG
+ context.set_warning_filter(log_level)
# Set the handler logging level of FileHandler(--log-file)
# and StreamHandler