提交 da87468e 编写于 作者: L Lukáš Doktor

avocado.utils.process: Log remaining buffer on exit

The SubProcess logs output only when it finishes with '\n' to avoid
partial outputs. Anyway we have to print the remaining buffer on
exit, otherwise we miss the unterminated output (eg on "echo -n")
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 8cadfa5a
......@@ -350,10 +350,10 @@ class SubProcess(object):
if self.verbose:
bfr += tmp
if tmp.endswith('\n'):
for l in bfr.splitlines():
log.debug(prefix, l)
for line in bfr.splitlines():
log.debug(prefix, line)
if stream_logger is not None:
stream_logger.debug(stream_prefix, l)
stream_logger.debug(stream_prefix, line)
bfr = ''
finally:
lock.release()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册