-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Provide log messages for the native server #12523
Comments
In addition to the log messages, it's also important for us to determine how to send these log messages to the client. Currently, all tracing logs are sent to stderr unless diverted by using the |
There was some internal discussion around using |
## Summary This pull request adds support for logging via `$/logTrace` RPC messages. It also enables that code path for when a client is Zed editor or VS Code (as there's no way for us to generically tell whether a client prefers `$/logTrace` over stderr. Related to: #12523 ## Test Plan I've built Ruff from this branch and tested it manually with Zed. --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
I think this is becoming more relevant because currently the user experience around viewing log messages isn't automatic. Currently, the default value of the ruff/crates/ruff_server/src/server/api.rs Lines 61 to 64 in a4ebe7d
Here, the client will display the notification with the message as in The differentiating factor is that which messages should always be logged ( |
Yeah. This doesn't seem like a good default. I think the default should be |
Do you mean the default trace value should be "messages"? The default value for the log level is Regardless, if we update the default trace value to be "messages", the output channel in the VS Code will be filled with the request - response cycle messages like:
We could have a separate output channel for the trace messages (similar to rust-analyzer) but that would also include the trace messages from the Ruff server. This is why we should also consider using |
Hmm. I would need to take a closer look at how our tracing setup works. Ideally, we would show info, warning, and error messages ( |
There aren't many log messages emitted by the server which can help in debugging. It would be quite useful to provide some more log messages at info / debug / trace levels.
Note that these log messages shouldn't include the request response messages because that's taken care by the editor. It should be specific to the server logic.
The text was updated successfully, but these errors were encountered: