Merge branch 'log-lines' into 'v3'
Strip new lines when logging stitching Closes #567 See merge request openflexure/openflexure-microscope-server!406
This commit is contained in:
commit
3d3ca9ebcf
1 changed files with 4 additions and 2 deletions
|
|
@ -300,7 +300,7 @@ class FinalStitcher(BaseStitcher):
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
bufsize=1,
|
bufsize=1,
|
||||||
universal_newlines=True,
|
text=True,
|
||||||
)
|
)
|
||||||
# Stop opening pipe blocking writing to it
|
# Stop opening pipe blocking writing to it
|
||||||
os.set_blocking(process.stdout.fileno(), False)
|
os.set_blocking(process.stdout.fileno(), False)
|
||||||
|
|
@ -344,5 +344,7 @@ class FinalStitcher(BaseStitcher):
|
||||||
|
|
||||||
def log_buffer(self, buffer: TextIOWrapper) -> None:
|
def log_buffer(self, buffer: TextIOWrapper) -> None:
|
||||||
"""Log everything in the buffer at INFO level."""
|
"""Log everything in the buffer at INFO level."""
|
||||||
|
# Use rstrip to remove newlines from each line, as logging provides its own
|
||||||
|
# new lines
|
||||||
while line := buffer.readline():
|
while line := buffer.readline():
|
||||||
self.logger.info(line)
|
self.logger.info(line.rstrip())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue