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
This commit is contained in:
parent
62cd3154c5
commit
2fc9b4f5ea
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue