-
Notifications
You must be signed in to change notification settings - Fork 304
Write log messages to files on non-Darwin platforms #1411
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 |
I re-wrote the implementation quite a bit based on feedback from @bnbarham to roll through 10 log files of 5MB each instead of truncating one log file in place since it reduces the number of bytes that need to be written (in the old implementation we needed to write 4MB every time we trimmed the start of the log). |
@swift-ci Please test |
@swift-ci Please test Windows |
/// Occasionally check if the log file exceeds the target log size. If this is the case, truncate the beginning of the | ||
/// log to reduce the log size. |
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 guess you could also say that the logs will be rotated if logRotateCount > 1
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, this comment is just completely outdated.
Instead of logging to `stderr`, write log messages to files in `.sourcekit-lsp/logs/sourcekit-lsp-<pid>.<log index>.log`. This allows us to retrieve the log messages from `sourcekit-lsp diagnose`. Fixes swiftlang#1286 rdar://127138318
@swift-ci Please test |
@swift-ci Please test Windows |
Instead of logging to
stderr
, write log messages to files in/var/log/sourcekit-lsp/sourcekit-lsp-<pid>.log
.This allows us to retrieve the log messages from
sourcekit-lsp diagnose
.Fixes #1286
rdar://127138318