From ea02f1fa5788267b151ae18b9b29dc4569cd6cff Mon Sep 17 00:00:00 2001 From: Yury <40732531+YorkFieldX@users.noreply.github.com> Date: Fri, 22 Jan 2021 05:39:41 +1100 Subject: [PATCH] Attempt to prevent logs getting stuck #2 --- Sources/LoggingFormatAndPipe/LoggerTextOutputStreamPipe.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/LoggingFormatAndPipe/LoggerTextOutputStreamPipe.swift b/Sources/LoggingFormatAndPipe/LoggerTextOutputStreamPipe.swift index fa3359a..5bf8917 100644 --- a/Sources/LoggingFormatAndPipe/LoggerTextOutputStreamPipe.swift +++ b/Sources/LoggingFormatAndPipe/LoggerTextOutputStreamPipe.swift @@ -30,6 +30,7 @@ public struct LoggerTextOutputStreamPipe: Pipe { var stream = self.stream if stream == nil { Swift.print("\(formattedLogLine)") + fflush(stdout) return } stream!.write("\(formattedLogLine)\n")