summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliu-sheng <liusheng@huawei.com>2014-06-24 09:20:49 +0800
committerliu-sheng <liusheng@huawei.com>2014-07-07 19:39:35 +0800
commit617f7f87cb19210382902ece612ba1d4e89ecde7 (patch)
tree04e53e5c52887b54a0399905ed3623666b9cbea2
parente5cd3b26b7b4dbf86b9665a459db50f4be93dd34 (diff)
downloadpython-ceilometerclient-617f7f87cb19210382902ece612ba1d4e89ecde7.tar.gz
Improve --debug logging output
This change makes the following improvements to the output of a ceilometer command with the --debug option set: * Silences spurious logging from iso8601 and urllib3.connectionpool * Removes the line number from the logging format, since the intent of --debug is to show the user what network requests are occuring. Change-Id: I1b286adf63b1ca05ec4fcfb27fbc939aa662cc7e Closes-bug: #1324470
-rw-r--r--ceilometerclient/shell.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ceilometerclient/shell.py b/ceilometerclient/shell.py
index 6e26f31..9d87b2c 100644
--- a/ceilometerclient/shell.py
+++ b/ceilometerclient/shell.py
@@ -221,11 +221,13 @@ class CeilometerShell(object):
subparser.set_defaults(func=callback)
def _setup_logging(self, debug):
- format = '%(levelname)s (%(module)s:%(lineno)d) %(message)s'
+ format = '%(levelname)s (%(module)s) %(message)s'
if debug:
logging.basicConfig(format=format, level=logging.DEBUG)
else:
logging.basicConfig(format=format, level=logging.WARN)
+ logging.getLogger('iso8601').setLevel(logging.WARNING)
+ logging.getLogger('urllib3.connectionpool').setLevel(logging.WARNING)
def parse_args(self, argv):
# Parse args once to find version