X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2F__init__.py;h=e19be36fdb0a0d652fbc5ae68b99d46ad1faf0a9;hb=4ea6acb22260ba5076857136c95a6f9223c9f7c5;hp=fbbc101a93b7ba7807673239b80b61023d69b0ee;hpb=5420dd71763226d78fb1ff486b78918432c73e49;p=yardstick.git diff --git a/yardstick/__init__.py b/yardstick/__init__.py index fbbc101a9..e19be36fd 100644 --- a/yardstick/__init__.py +++ b/yardstick/__init__.py @@ -35,17 +35,18 @@ LOG = logging.getLogger(__name__) def _init_logging(): - _LOG_STREAM_HDLR.setFormatter(_LOG_FORMATTER) + LOG.setLevel(logging.DEBUG) + _LOG_STREAM_HDLR.setFormatter(_LOG_FORMATTER) + if os.environ.get('CI_DEBUG', '').lower() in {'1', 'y', "yes", "true"}: + _LOG_STREAM_HDLR.setLevel(logging.DEBUG) + else: + _LOG_STREAM_HDLR.setLevel(logging.INFO) # don't append to log file, clobber _LOG_FILE_HDLR.setFormatter(_LOG_FORMATTER) + _LOG_FILE_HDLR.setLevel(logging.DEBUG) del logging.root.handlers[:] logging.root.addHandler(_LOG_STREAM_HDLR) logging.root.addHandler(_LOG_FILE_HDLR) logging.debug("logging.root.handlers = %s", logging.root.handlers) - - if os.environ.get('CI_DEBUG', '').lower() in {'1', 1, 'y', "yes", "true"}: - LOG.setLevel(logging.DEBUG) - else: - LOG.setLevel(logging.INFO)