Log each line individually to ensure line breaks
This commit is contained in:
parent
e1110bfe5d
commit
3eea4bbaf6
1 changed files with 2 additions and 5 deletions
|
|
@ -965,12 +965,9 @@ class SmartScanThing(Thing):
|
||||||
|
|
||||||
def log_buffer(buffer):
|
def log_buffer(buffer):
|
||||||
"""A short internal function to read everything in the buffer to
|
"""A short internal function to read everything in the buffer to
|
||||||
a multiline string and log"""
|
the log"""
|
||||||
lines = []
|
|
||||||
while line := buffer.readline():
|
while line := buffer.readline():
|
||||||
lines.append(line)
|
logger.info(line)
|
||||||
if lines:
|
|
||||||
logger.info("".join(lines))
|
|
||||||
|
|
||||||
# Run the command piping stdout into the process for reading and
|
# Run the command piping stdout into the process for reading and
|
||||||
# forwarding the stdrerr to stdout
|
# forwarding the stdrerr to stdout
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue