Skip to content

Commit e8e10e6

Browse files
committed
Fix logging output when commands finish executing and pipes are empty
1 parent 361f810 commit e8e10e6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

devlab_bench/helpers/command.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,15 @@ def _process_output(self, max_lines=100, flush=False):
175175
stdout_dangle = self._sanitize_string(self.proc.stdout.read())
176176
if stdout_dangle:
177177
if self.log_output:
178-
self.log.info(stdout_dangle)
178+
for stdout_dangle_line in stdout_dangle.splitlines():
179+
self.log.info(stdout_dangle_line)
179180
self.stdout.append(stdout_dangle)
180181
if self.proc.stderr:
181182
stderr_dangle = self._sanitize_string(self.proc.stderr.read())
182183
if stderr_dangle:
183184
if self.log_output:
184-
self.log.error(stderr_dangle)
185+
for stderr_dangle_line in stderr_dangle.splitlines():
186+
self.log.warning(stderr_dangle_line)
185187
self.stderr.append(stderr_dangle)
186188
break
187189
except OSError:

0 commit comments

Comments
 (0)