1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

oeqa/utils: Added filter to LogResults decorator to enforce custom log level.

(From OE-Core rev: 65c97d4abd26f38917cd89b5f50f7299221b2123)

Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Lucian Musat
2014-09-24 11:28:48 +03:00
committed by Richard Purdie
parent 3ad2f855a7
commit 576cb358d7
+6
View File
@@ -91,6 +91,10 @@ class testcase(object):
wrapped_f.test_case = self.test_case
return wrapped_f
class NoParsingFilter(logging.Filter):
def filter(self, record):
return record.levelno == 100
def LogResults(original_class):
orig_method = original_class.run
@@ -121,6 +125,8 @@ def LogResults(original_class):
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
datefmt='%H:%M:%S',
level=custom_log_level)
for handler in logging.root.handlers:
handler.addFilter(NoParsingFilter())
local_log = logging.getLogger(caller)
#check status of tests and record it