Skip to content

feat: add reloadable LSP logging and setTrace support#111

Merged
coder3101 merged 5 commits into
coder3101:mainfrom
AlexCannonball:feat/logging-improvements
May 5, 2026
Merged

feat: add reloadable LSP logging and setTrace support#111
coder3101 merged 5 commits into
coder3101:mainfrom
AlexCannonball:feat/logging-improvements

Conversation

@AlexCannonball
Copy link
Copy Markdown
Contributor

Overview

This PR implements a more idiomatic LSP logging system. It shifts from static file-based logging to a dynamic, reloadable system that communicates directly with the LSP client.

neovim user experience (e.g. via :messages):

image

VS Code user experience (old output channel):

image

This will be even better when an Extension uses the modern LogOutputChannel (with options: {log: true}).

Changes

  • New log module: Added a custom tracing layer (ClientLogger) that forwards logs to the LSP client via an asynchronous channel.
  • Dynamic Filtering: Integrated tracing_subscriber::reload to allow real-time log level updates.
  • LSP Protocol Support: Implemented the $/setTrace notification handler in ProtoLanguageServer.
  • Unit Tests: Added tests for the new logging layer and level-update logic.

How to test

  1. Run the server.
  2. From the LSP client, send a $/setTrace notification with value verbose.
  3. Observe the desired TRACE and DEBUG logs appearing in the editor's output channel.

Compatibility

I've replaced the previous file-logging implementation to avoid cluttering. Please let me know if you would prefer to keep the file appender as a concurrent logging layer; I can easily add it back as an additional tracing layer.

Fixes #110

Comment thread src/log.rs Outdated
Comment thread src/log.rs Outdated
Comment thread src/main.rs
Copy link
Copy Markdown
Owner

@coder3101 coder3101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.
Some feedback and rest LGTM

@AlexCannonball
Copy link
Copy Markdown
Contributor Author

Thanks for your contribution. Some feedback and rest LGTM

Thank you for your review, I've addressed the comments. Would you like me to squash the commits into one feat: add reloadable LSP logging and setTrace support before merging?

@AlexCannonball AlexCannonball requested a review from coder3101 May 5, 2026 21:53
@coder3101 coder3101 enabled auto-merge (squash) May 5, 2026 22:52
@coder3101 coder3101 merged commit 3042206 into coder3101:main May 5, 2026
1 check passed
@AlexCannonball AlexCannonball deleted the feat/logging-improvements branch May 6, 2026 11:53
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.

Improve logging: add support for LSP $/setTrace and window/logMessage

2 participants