-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SourceKit: add a newline to logged messages #37614
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
Conversation
@swift-ci please test |
CC: @benlangmuir |
@@ -109,9 +109,9 @@ class Logger : public llvm::RefCountedBase<Logger> { | |||
#define LOG_FUNC_SECTION_WARN LOG_FUNC_SECTION(Warning) | |||
|
|||
#define LOG(NAME, LEVEL, msg) LOG_SECTION(NAME, LEVEL) \ | |||
do { *Log << msg; } while (0) | |||
do { *Log << msg << '\n'; } while (0) |
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.
I wonder if this should move into Logger::~Logger
so that it applies to all LOG_SECTION. We could also check dynamically there whether log message already ended with a newline. @akyrtzi any opinion?
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.
I wonder if this should move into Logger::~Logger
Sounds like a good idea!
We could also check dynamically there whether log message already ended with a newline
I don't think it's necessary, I'd prefer to keep it simple.
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.
Oh, I'm strongly in favour of that idea. Thanks!
BTW, this should fix the following logging that I se:
sourcekit: [2:canUseASTWithSnapshots: 8.7614] will try existing ASTsourcekit: [2:handleRequest-after: 8.7619] {
Add a trailing newline to log messages in SourceKit to ensure that messages are not merged with surrounding messages.
@swift-ci please test |
Build failed |
@swift-ci please test Windows platform |
@swift-ci please test Linux platform |
@swift-ci please test Windows platform |
Add a trailing newline to log messages in SourceKit to ensure that
messages are not merged with surrounding messages.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.