From 51522bd5ac0015a6b0f63682478b7c31bc1b4398 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 30 Mar 2012 10:42:00 -0700 Subject: [PATCH] Pass cli args to logging configure, will be used soon, and use < INFO instead of <= DEBUG --- devstack/utils.py | 2 +- stack | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/devstack/utils.py b/devstack/utils.py index 5e921010..512d6c4f 100644 --- a/devstack/utils.py +++ b/devstack/utils.py @@ -83,7 +83,7 @@ def construct_log_level(verbosity_level, dry_run=False): return log_level -def configure_logging(log_level): +def configure_logging(log_level, cli_args): root_logger = logging.getLogger().logger console_logger = logging.StreamHandler(sys.stdout) console_format = '%(levelname)s: @%(name)s : %(message)s' diff --git a/stack b/stack index 4927e6a5..03e63ad4 100755 --- a/stack +++ b/stack @@ -180,7 +180,7 @@ def main(): # Configure logging log_level = utils.construct_log_level(args['verbosity'], args['dryrun']) - utils.configure_logging(log_level) + utils.configure_logging(log_level, args) LOG.debug("Command line options %s" % (args)) LOG.debug("Log level is: %s" % (log_level)) @@ -209,8 +209,9 @@ def main(): except Exception: utils.goodbye(False) traceback = None - if log_level <= logging.DEBUG: + if log_level < logging.INFO: # See: http://docs.python.org/library/traceback.html + # When its not none u get more detailed info about the exception traceback = sys.exc_traceback tb.print_exception(sys.exc_type, sys.exc_value, traceback, file=sys.stdout)