From 617f7f87cb19210382902ece612ba1d4e89ecde7 Mon Sep 17 00:00:00 2001 From: liu-sheng Date: Tue, 24 Jun 2014 09:20:49 +0800 Subject: 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 --- ceilometerclient/shell.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1