Merge "Enable debug logging in unit tests"
This commit is contained in:
commit
2d64192865
|
@ -46,16 +46,16 @@ TEST_DEFAULT_LOGLEVELS = {'migrate': logging.WARN,
|
|||
'sqlalchemy': logging.WARN,
|
||||
'heat.engine.environment': logging.ERROR}
|
||||
_LOG_FORMAT = "%(levelname)8s [%(name)s] %(message)s"
|
||||
_TRUE_VALUES = ('True', 'true', '1', 'yes')
|
||||
_FALSE_VALUES = {'False', 'false', '0', 'no'}
|
||||
|
||||
|
||||
class FakeLogMixin(object):
|
||||
def setup_logging(self, quieten=True):
|
||||
# Assign default logs to self.LOG so we can still
|
||||
# assert on heat logs.
|
||||
default_level = logging.INFO
|
||||
if os.environ.get('OS_DEBUG') in _TRUE_VALUES:
|
||||
default_level = logging.DEBUG
|
||||
default_level = logging.DEBUG
|
||||
if os.environ.get('OS_DEBUG') in _FALSE_VALUES:
|
||||
default_level = logging.INFO
|
||||
|
||||
self.LOG = self.useFixture(
|
||||
fixtures.FakeLogger(level=default_level, format=_LOG_FORMAT))
|
||||
|
|
Loading…
Reference in New Issue