Default test log level to DEBUG except for testr
When running under testr, default the test log level to INFO, but otherwise, default it to DEBUG. This way when a developer runs a test in the foreground it logs at DEBUG without any further configuration needed. Change-Id: Ie7388ebf25669807a8c430b6908f9d18115b5dc6
This commit is contained in:
parent
b4f9c61e84
commit
79e94b6bdd
@ -1,4 +1,4 @@
|
||||
[DEFAULT]
|
||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} OS_LOG_DEFAULTS=${OS_LOG_DEFAULTS:-""} ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION
|
||||
test_command=OS_LOG_LEVEL=${OS_LOG_LEVEL:-INFO} OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} OS_LOG_DEFAULTS=${OS_LOG_DEFAULTS:-""} ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
||||
|
@ -857,9 +857,11 @@ class BaseTestCase(testtools.TestCase):
|
||||
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
|
||||
if (os.environ.get('OS_LOG_CAPTURE') == 'True' or
|
||||
os.environ.get('OS_LOG_CAPTURE') == '1'):
|
||||
log_level = logging.INFO
|
||||
log_level = logging.DEBUG
|
||||
if os.environ.get('OS_LOG_LEVEL') == 'DEBUG':
|
||||
log_level = logging.DEBUG
|
||||
elif os.environ.get('OS_LOG_LEVEL') == 'INFO':
|
||||
log_level = logging.INFO
|
||||
elif os.environ.get('OS_LOG_LEVEL') == 'WARNING':
|
||||
log_level = logging.WARNING
|
||||
elif os.environ.get('OS_LOG_LEVEL') == 'ERROR':
|
||||
|
Loading…
Reference in New Issue
Block a user