Skip to contentSkip to conversation

oeqa/core/runner.py: OEStreamLogger fix logging

PATCH New Aníbal Limón 1 participant 1 message Feb 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/core/runner.py: OEStreamLogger fix logging

Change conditional to avoid losing stack traces when log into the logger. The logic only needs to don't log empty lines.

---
 meta/lib/oeqa/core/runner.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/core/runner.py +1 -1
index 8f5af57..0f158c3 100644
@@ -23,7 +23,7 @@ class OEStreamLogger(object):
         self.buffer = ""
 
     def write(self, msg):
-        if msg[-1] != '\n':
+        if len(msg) > 1 and msg[0] != '\n':
             self.buffer += msg
         else:
             self.logger.log(logging.INFO, self.buffer.rstrip("\n"))
Signature · 1 line
2.1.4