Shockp commented on code in PR #49663:
URL: https://github.com/apache/arrow/pull/49663#discussion_r3116315653
##########
cpp/src/arrow/util/logging.cc:
##########
@@ -67,7 +68,7 @@ class CerrLog {
virtual ~CerrLog() {
if (has_logged_) {
- std::cerr << std::endl;
+ std::cerr << buffer_.str() << std::endl;
Review Comment:
Thanks for the review. Even with the stringstream buffer, the final write
and the std::endl flush could still interleave at the OS level across multiple
threads. I'll add a static mutex to the CerrLog destructor to lock the final
write, and I'll add a test in logging_test.cc to spawn multiple threads to
verify the clean output.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]