Skip to content
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

Adjust trace level of running server #1310

Merged
merged 1 commit into from Oct 14, 2022
Merged

Adjust trace level of running server #1310

merged 1 commit into from Oct 14, 2022

Conversation

mainej
Copy link
Collaborator

@mainej mainej commented Oct 6, 2022

This is the clojure-lsp side of clojure-lsp/lsp4clj#28. A server can be started at the messages or verbose trace level. While it's running, its trace level can be changed by sending it a new level in the initialize request or a $/setTrace notification.

A good way to test this is in Calva. While watching the server's logs, change Clojure > Trace: Server to 'messages' or 'verbose', then go back to a .clj file. You should start seeing traces in the logs. You can turn the traces off by changing the setting back to 'off'. This works because Calva already sends $/setTrace when that setting is changed. Other editors may not send $/setTrace yet.

Somewhat unrelated:

The --verbose option in the CLI doesn't seem to do anything. Should it be removed?

While working on this I discovered the $/logTrace notification, a notification servers can use to ask clients to "log the trace of the server’s execution". I'm not sure what to make of it. Should we be sending that notification instead of putting traces in the log file? If we do, where would they show up? Alongside the client's own traces? Or are we supposed to send both traces and logs to the client via $/logTrace? If so, that might significantly simplify our logging infrastructure. On the other hand, we'd lose the persistent log files.

@mainej mainej requested a review from ericdallo October 6, 2022 00:37
@ericdallo
Copy link
Member

ericdallo commented Oct 6, 2022

While working on this I discovered the $/logTrace notification, a notification servers can use to ask clients to "log the trace of the server’s execution". I'm not sure what to make of it. Should we be sending that notification instead of putting traces in the log file? If we do, where would they show up? Alongside the client's own traces? Or are we supposed to send both traces and logs to the client via $/logTrace? If so, that might significantly simplify our logging infrastructure. On the other hand, we'd lose the persistent log files.

Yeah, I don't know too, but I'd like to have control over the log on server side

@ericdallo ericdallo merged commit ea0f6ed into master Oct 14, 2022
@ericdallo ericdallo deleted the adjust-trace-level branch October 14, 2022 21:46
@mainej mainej mentioned this pull request Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants