Shockp opened a new pull request, #49663: URL: https://github.com/apache/arrow/pull/49663
### Rationale for this change When using the C++ `ARROW_LOG` macros from multiple threads, messages often get mingled together in `stderr` because the `operator<<` writes directly to the global stream piece-by-piece, which is not thread-safe. ### What changes are included in this PR? This PR introduces an internal `std::ostringstream` buffer to the fallback `CerrLog` class. Instead of writing to `std::cerr` immediately on every `<<` operation, the messages are accumulated locally within the `CerrLog` instance. The completed string is then flushed atomically to `std::cerr` upon the object's destruction. ### Are these changes tested? Yes. I built the C++ project locally and ran the test suite (`ctest`) to ensure no existing logging behavior or IPC functionality was broken. ### Are there any user-facing changes? No API changes. Users will simply notice that multi-threaded `ARROW_LOG` console output is now cleanly separated per line instead of interleaved. Closes #49433 -- 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]
