-
Notifications
You must be signed in to change notification settings - Fork 307
Add a document to describe which log level to use #1474
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
Also change a few log levels and make all log messages consistently start with an uppercase letter.
@swift-ci Please test |
|
||
## Log Levels | ||
|
||
The following log levels should be used by log messages in default. The [Explore logging in Swift](https://developer.apple.com/wwdc20/10168?time=604) session from WWDC20 has some explanation of how these levels are persisted by OS log and we follow those guidelines. |
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.
Not sure I understand should be used by log messages in default
- Preparation of a file failed due to a syntax error in the user’s code | ||
- The index contains a reference to a source file but the source fail has been modified since the index was last updated and is thus no longer valid | ||
|
||
## Log/Notice/Default |
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.
Is this (and the following headers) intentionally H2 instead of H3?
|
||
> From Explore Logging in Swift: _Essential for troubleshooting_ | ||
|
||
Essential state transitions during SourceKit-LSP’s execution that allow use to determine what interactions the user performed. These logs will most likely be included in diagnose bundles from `sourcekit-lsp` diagnose and should help us solve most problems. |
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.
Essential state transitions during SourceKit-LSP’s execution that allow use to determine what interactions the user performed. These logs will most likely be included in diagnose bundles from `sourcekit-lsp` diagnose and should help us solve most problems. | |
Essential state transitions during SourceKit-LSP’s execution that allow us to determine what interactions the user performed. These logs will most likely be included in diagnose bundles from `sourcekit-lsp diagnose` and should help us solve most problems. |
|
||
> From Explore Logging in Swift: _Helpful but not essential for troubleshooting_ (not persisted, logged to memory) | ||
|
||
Internal state transitions that are helpful. If eg. a request fails and it’s not immediately obvious at which it failed, these should help us narrow down the code that it failed in. These messages might be missing from the logs generated by `sourcekit-lsp diagnose` and should not generally be needed to fix issues |
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.
Internal state transitions that are helpful. If eg. a request fails and it’s not immediately obvious at which it failed, these should help us narrow down the code that it failed in. These messages might be missing from the logs generated by `sourcekit-lsp diagnose` and should not generally be needed to fix issues | |
Internal state transitions that are helpful. If eg. a request fails and it’s not immediately obvious at which point it failed, these should help us narrow down the code that it failed in. These messages might be missing from the logs generated by `sourcekit-lsp diagnose` and should not generally be needed to fix issues |
|
||
> From Explore Logging in Swift: _Useful only during debugging_ (only logged during debugging) | ||
|
||
Log messages that are useful eg. when debugging a test failure but that is not needed for diagnosing most real-world issues, like detailed information about when a function starts executing to diagnose race conditions. |
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.
Log messages that are useful eg. when debugging a test failure but that is not needed for diagnosing most real-world issues, like detailed information about when a function starts executing to diagnose race conditions. | |
Log messages that are useful eg. when debugging a test failure but are not needed for diagnosing most real-world issues, like detailed information about when a function starts executing to diagnose race conditions. |
Also change a few log levels and make all log messages consistently start with an uppercase letter.