]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/core/runner.py: OEStreamLogger fix logging
authorAníbal Limón <anibal.limon@linux.intel.com>
Thu, 9 Feb 2017 20:53:17 +0000 (14:53 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Feb 2017 17:29:42 +0000 (09:29 -0800)
Change conditional to avoid losing stack traces when log
into the logger. The logic only needs to don't log empty lines.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/runner.py

index 8f5af579f3416eb417b586dd1ddb93ef351e90a7..0f158c39f1a91e315ccfe6efcc80a72c5f11ee03 100644 (file)
@@ -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"))