Skip to content

Log server Info messages only if TRACE is enabled.#1523

Open
raghucssit wants to merge 1 commit intoeclipse-lsp4e:mainfrom
raghucssit:log_info_on_trace
Open

Log server Info messages only if TRACE is enabled.#1523
raghucssit wants to merge 1 commit intoeclipse-lsp4e:mainfrom
raghucssit:log_info_on_trace

Conversation

@raghucssit
Copy link
Copy Markdown
Contributor

see #1522

Copilot AI review requested due to automatic review settings April 16, 2026 21:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts LSP server message logging to avoid polluting the Eclipse Error Log view with low-severity messages unless tracing is explicitly enabled (per issue #1522).

Changes:

  • Gate MessageType.Info (and the switch default branch) logging behind LanguageServerPlugin.isLogTraceEnabled().
  • Keep existing behavior for Error and Warning messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +92 to +94
if (LanguageServerPlugin.isLogTraceEnabled()) {
LanguageServerPlugin.logInfo(log.toString());
}
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

This now gates INFO (and the default branch) behind LanguageServerPlugin.isLogTraceEnabled() (debug option org.eclipse.lsp4e/trace). The shipped org.eclipse.lsp4e/.options currently only declares org.eclipse.lsp4e/debug, so the trace option isn’t discoverable when launching with -debug. Consider adding/documenting org.eclipse.lsp4e/trace in the plugin’s .options (and/or user-facing docs) so users can actually enable these logs when needed.

Copilot uses AI. Check for mistakes.
@FlorianKroiss
Copy link
Copy Markdown
Contributor

FlorianKroiss commented Apr 17, 2026

Hi @raghucssit,

I don't think it's a good idea to hide these message is general.

That being said, I ran into a similar problem with a LS that was logging a lot of messages with INFO level.
To solve it, we made the *Message methods on DefaultLanguageClient non-final, see #1370.
This way, you can override the logMessage method in your own subclass and filter out some messages there.

@rubenporras
Copy link
Copy Markdown
Contributor

I also do not think this is a problem that should be solved by suppressing messages on LSP4E by default. I think #1370 or fixing the offending language server is a better option.

@raghucssit
Copy link
Copy Markdown
Contributor Author

I have moved this filtering to github copilot repo. I will close this as needed later once that pr is merged.

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.

4 participants