[env_logger] Adds a newline to format string before writing #219
No reviewers
Labels
No labels
bug
duplicate
easy
enhancement
help wanted
invalid
question
rfc
structured-logging
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-rust-lang/log!219
Loading…
Reference in a new issue
No description provided.
Delete branch "atomic_newline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is important so in unix systems most of the time buffer is output
atomically (until certain length of message). Which means you don't get
two lines squashed together if they are written simultaneously.
I believe most of the time it's doesn't influence performance, because
underlying buffer of string is probably overallocated a bit anyway.
Stdout is line buffered - when will this change behavior?
Is it? I observe broken logs every time I start two processes. Logs are written to stderr by default, though. Is there any difference between stdout and stderr?
Well, it looks like undocumented, but yes, stdout is line buffered whereas stderr isn't. So we could revert to the old behavior on stdout.
Done. Also fixed bug. (I used to think that it's enough to run tests in root directory rather than
env)Thanks for this @tailhook! Do you mind rebasing this over at https://github.com/sebasmagri/env_logger, which is the new home for
env_logger?Well, it's not so useful after: https://github.com/sebasmagri/env_logger/pull/19
I'm not sure what to do:
We've started discussing this over in https://github.com/sebasmagri/env_logger/issues/22 so I'll close this PR now. I'd definitely like to come up with a good solution to this before a
1.0ofenv_logger!Pull request closed