diff options
author | Randall Burt <randall.burt@rackspace.com> | 2014-01-28 13:31:37 -0500 |
---|---|---|
committer | Randall Burt <randall.burt@rackspace.com> | 2014-01-30 11:28:16 -0500 |
commit | 2fc9b4f5ea9cb6e01f7116a099e63b197181f71a (patch) | |
tree | 53c266e59c9bbd202daf47f12db83b94de7c3b08 | |
parent | 62cd3154c5ee0380f9ae848f63c60d48fccb6c2e (diff) | |
download | python-heatclient-2fc9b4f5ea9cb6e01f7116a099e63b197181f71a.tar.gz |
Configure logging regardless of debug flag
Configure the logging level for the client. Default to ERROR
unless -d is passed, then use DEBUG.
Closes-Bug: #1273800
Change-Id: Iea337bed55ca7da2fc95d0d3218a4895909423cd
-rw-r--r-- | heatclient/shell.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/heatclient/shell.py b/heatclient/shell.py index 9d136a6..c6fa947 100644 --- a/heatclient/shell.py +++ b/heatclient/shell.py @@ -271,11 +271,11 @@ class HeatShell(object): service_type=kwargs.get('service_type') or 'orchestration', endpoint_type=kwargs.get('endpoint_type') or 'publicURL') - def _setup_debugging(self, debug): - if debug: - logging.basicConfig( - format="%(levelname)s (%(module)s:%(lineno)d) %(message)s", - level=logging.DEBUG) + def _setup_logging(self, debug): + log_lvl = logging.DEBUG if debug else logging.ERROR + logging.basicConfig( + format="%(levelname)s (%(module)s:%(lineno)d) %(message)s", + level=log_lvl) def _setup_verbose(self, verbose): if verbose: @@ -285,7 +285,7 @@ class HeatShell(object): # Parse args once to find version parser = self.get_base_parser() (options, args) = parser.parse_known_args(argv) - self._setup_debugging(options.debug) + self._setup_logging(options.debug) self._setup_verbose(options.verbose) # build available subcommands based on version |