UCS/LOG: Print multi-line logs in a single operation#11082
Closed
guy-ealey-morag wants to merge 9 commits intoopenucx:masterfrom
Closed
UCS/LOG: Print multi-line logs in a single operation#11082guy-ealey-morag wants to merge 9 commits intoopenucx:masterfrom
guy-ealey-morag wants to merge 9 commits intoopenucx:masterfrom
Conversation
iyastreb
reviewed
Jan 5, 2026
brminich
reviewed
Jan 9, 2026
Contributor
Author
87c1e2a to
5c118a1
Compare
iyastreb
reviewed
Jan 15, 2026
beca5fa to
a540606
Compare
a540606 to
c1d7826
Compare
brminich
reviewed
Jan 19, 2026
brminich
reviewed
Jan 20, 2026
d1a2f4b to
8fc40e2
Compare
brminich
previously approved these changes
Jan 21, 2026
iyastreb
reviewed
Jan 26, 2026
7baf385 to
c05a638
Compare
c05a638 to
d1a390d
Compare
Contributor
Author
|
I refactored the code to have a single printing logic that is reused for single line and multi line logs ( |
Contributor
Author
|
A complete solution to this issue will be using Closing until it's prioritized again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Print multi-line logs in a single operation to avoid other logs from being interleaved between them, and improve logging efficiency.
Why?
This is done to avoid any other logs from interleaving between multi-line logs, which until now were printed one-by-one.
How?
Every log is tested for
\n, if it has at least one then it's printed with the multi-line logic, otherwise it's printed using the existing logic (the separation allows more efficient handling of the single line case).Also, added detection for logs that don't require formatting (ones that use
"%s"as their format string), in this case the argument is used as-is and there is no need to spend time and resources on formatting them.This allows printing buffers that are larger than what
ucs_alloca()allows.Notice that this approach required removing the use of
strtok_rbecause it is modifying the given string.