summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucian Musat <georgex.l.musat@intel.com>2014-09-24 11:28:48 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-29 12:12:44 +0100
commit576cb358d7a1245e3c5fb4463310552aef218fb2 (patch)
treef21265d20e6299f000d3f407da619b0be8ffca76
parent3ad2f855a79f29deb1b3b26ec99c7624e1b494f6 (diff)
downloadpoky-576cb358d7a1245e3c5fb4463310552aef218fb2.tar.gz
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>
-rw-r--r--meta/lib/oeqa/utils/decorators.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index a9e67ed863..7f845dbb4b 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -91,6 +91,10 @@ class testcase(object):
91 wrapped_f.test_case = self.test_case 91 wrapped_f.test_case = self.test_case
92 return wrapped_f 92 return wrapped_f
93 93
94class NoParsingFilter(logging.Filter):
95 def filter(self, record):
96 return record.levelno == 100
97
94def LogResults(original_class): 98def LogResults(original_class):
95 orig_method = original_class.run 99 orig_method = original_class.run
96 100
@@ -121,6 +125,8 @@ def LogResults(original_class):
121 format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', 125 format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
122 datefmt='%H:%M:%S', 126 datefmt='%H:%M:%S',
123 level=custom_log_level) 127 level=custom_log_level)
128 for handler in logging.root.handlers:
129 handler.addFilter(NoParsingFilter())
124 local_log = logging.getLogger(caller) 130 local_log = logging.getLogger(caller)
125 131
126 #check status of tests and record it 132 #check status of tests and record it