Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bumped ansible version to 2.2.2.
[yardstick.git]
/
yardstick
/
__init__.py
diff --git
a/yardstick/__init__.py
b/yardstick/__init__.py
index
fbbc101
..
2f5ae9f
100644
(file)
--- a/
yardstick/__init__.py
+++ b/
yardstick/__init__.py
@@
-20,8
+20,8
@@
from yardstick.common import utils as yardstick_utils
# without having to install apexlake.
sys.path.append(os.path.dirname(apexlake.__file__))
# without having to install apexlake.
sys.path.append(os.path.dirname(apexlake.__file__))
-yardstick_utils.makedirs(constants.
YARDSTICK_
LOG_DIR)
-LOG_FILE = os.path.join(constants.
YARDSTICK_
LOG_DIR, 'yardstick.log')
+yardstick_utils.makedirs(constants.LOG_DIR)
+LOG_FILE = os.path.join(constants.LOG_DIR, 'yardstick.log')
LOG_FORMATTER = ('%(asctime)s '
'%(name)s %(filename)s:%(lineno)d '
'%(levelname)s %(message)s')
LOG_FORMATTER = ('%(asctime)s '
'%(name)s %(filename)s:%(lineno)d '
'%(levelname)s %(message)s')
@@
-35,17
+35,18
@@
LOG = logging.getLogger(__name__)
def _init_logging():
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)
# 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)
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)