Lower the log level in tests
The subunit output size is already nearing 50MB, which is the maximum
allowed by jenkins jobs. Lower the log level to INFO, which should be
enough for normal test runs and lower the output size significantly.
Co-Authored-By: Joshua Hesketh <josh@nitrotech.org>
Change-Id: Ia6adc28a7bda482595df4b5f3b144f150e3a441e
diff --git a/tests/base.py b/tests/base.py
index 01097c1..ab608cb 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -857,8 +857,17 @@
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
+ if os.environ.get('OS_LOG_LEVEL') == 'DEBUG':
+ log_level = logging.DEBUG
+ elif os.environ.get('OS_LOG_LEVEL') == 'WARNING':
+ log_level = logging.WARNING
+ elif os.environ.get('OS_LOG_LEVEL') == 'ERROR':
+ log_level = logging.ERROR
+ elif os.environ.get('OS_LOG_LEVEL') == 'CRITICAL':
+ log_level = logging.CRITICAL
self.useFixture(fixtures.FakeLogger(
- level=logging.DEBUG,
+ level=log_level,
format='%(asctime)s %(name)-32s '
'%(levelname)-8s %(message)s'))