-
Notifications
You must be signed in to change notification settings - Fork 296
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
Combine multiple prints to a single one #1396
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true in the general case that we can't / don't want to buffer everything entirely before printing it. That needs big continuous memory buffers and can be detrimental to figuring out where things happen.
However, I don't think those concerns apply to the cases described here, so I'm inclined to take this. Thanks!
(I also don't think taking this implies anything about what we want to do across threads :) )
@@ -1437,28 +1437,33 @@ namespace vcpkg | |||
} | |||
|
|||
template<class Message> | |||
static void print_build_result_summary_line(Message build_result_message, int count) | |||
static void append_build_result_summary_line(Message build_result_message, int count, LocalizedString& str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a generic environment I would oppose a function including the '\n'
because it's very easy to add one on later and a pain to deal with if one is already there. However, in this case, it's a static function clearly used only immediately below where the newline is necessary, so I think it's OK.
} | ||
to_print.append_raw('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review/note: This isn't a change, used to be on 455
Thanks :) |
The goal is to avoid interception with other prints from different threads.
Originally, I wanted to delete
println()
entirely, but it's used byprint_error_message()
. This function parses the given string to add error colorization. It's used to print e.g. JSON parsing errors.