-
Notifications
You must be signed in to change notification settings - Fork 483
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
stdout buffer causes messages not to be delivered on arrival #3
Comments
Would a command-line option to turn on unbuffered I/O be sufficient? |
Yea agreed. Making it configurable would enable it to work in either case
|
Shouldn't there still be a flush after a given timeout though? I can't
|
You are probably right, I'll look into it. |
OK thinking about it a little more. A command-line arg to set buffered
|
Yeah, the downside of |
By default, stdout is buffered. If writing out to a terminal, it will flush after each newline. However, if the stdout is redirected, it won't flush on each newline. It can be flushed manually or the buffer can be disabled.
http://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newline-is-in-the-format-strin
Something like this could fix the problem:
Or the buffer can be flushed manually after each write.
I made this an issue rather than a PR because I'm not sure of the best way to handle it.
The text was updated successfully, but these errors were encountered: