Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log output not interleaved with XCTest output #44

Closed
pitfield opened this issue Aug 15, 2022 · 0 comments
Closed

Log output not interleaved with XCTest output #44

pitfield opened this issue Aug 15, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@pitfield
Copy link
Member

In Swift 5.6.1 (Xcode 13.4.1), when running the test suite from the command line, the PostgresClientKit log output is not properly interleaved with the XCTest output. Instead, the log output appears after all XCTest output. This makes it difficult to correlate the log output to specific tests.

I'm not seeing this when running the test suite within Xcode or on Linux.

By default, LogHandler emits log output to stdout using print(...). It appears that print(...) is now buffering output, which is why the log output is not immediately visible.

Replacing print(...) with FileHandle.standardOutput.write(:_) seems to do the trick.

pitfield added a commit that referenced this issue Aug 24, 2022
@pitfield pitfield self-assigned this Aug 24, 2022
@pitfield pitfield added the bug Something isn't working label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant