mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-11-09 19:14:04 +01:00
fix: formatting of stdout, stderr captured text for logger
This commit is contained in:
1 parent
bee51bd86e
commit
939f834a26
2 files changed
+6
-5
No files matched your search
@@ -130,15 +130,15 @@ class BECWidgetsCLIServer:
|
||||
class SimpleFileLikeFromLogOutputFunc:
|
||||
def __init__(self, log_func):
|
||||
self._log_func = log_func
|
||||
self._buffer = []
|
||||
|
||||
def write(self, buffer):
|
||||
for line in buffer.rstrip().splitlines():
|
||||
line = line.rstrip()
|
||||
if line:
|
||||
self._log_func(line)
|
||||
self._buffer.append(buffer)
|
||||
|
||||
def flush(self):
|
||||
return
|
||||
lines, _, remaining = "".join(self._buffer).rpartition("\n")
|
||||
self._log_func(lines)
|
||||
self._buffer = [remaining]
|
||||
|
||||
def close(self):
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user