8000 [#88] Fix: Grammar warnings spam stderr by ddscharfe · Pull Request #90 · eclipse-cdt/cdt-lsp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[#88] Fix: Grammar warnings spam stderr #90

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

Merged
merged 1 commit into from
May 17, 2023

Conversation

ddscharfe
Copy link
Contributor

Fixes issue #88

Copy link
Contributor
@ghentschke ghentschke left a comment

Choose a reason for hiding this comment

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

Thank you!

@ddscharfe
Copy link
Contributor Author

Note that this requires org.eclipse.tm4e.core:0.5.4. So until the target platform is updated this will have no effect.

@ghentschke ghentschke merged commit e248180 into eclipse-cdt:master May 17, 2023
@@ -50,6 +53,9 @@ public void start(BundleContext context) throws Exception {
workspaceTracker.open();
workspace = workspaceTracker.getService();
cLanguageServerProvider = new CLanguageServerRegistry().createCLanguageServerProvider();

// Disable warnings, see https://github.com/eclipse-cdt/cdt-lsp/issues/88
Logger.getLogger("").setLevel(Level.SEVERE);
Copy link
Member

Choose a reason for hiding this comment

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

With the fix in https://github.com/eclipse/tm4e/pull/535/files does that mean this line isn't needed? It seems quite overkill for CDT LSP to set the level of the logger here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the fix in https://github.com/eclipse/tm4e/pull/535/files does that mean this line isn't needed? It seems quite overkill for CDT LSP to set the level of the logger here.

Unfortunately not. The tm4e fix changed that instead of always printing to stderr, the logger is used (warning level). However, we could also just set the logging level for the class which is concerned. I didn't do this in this PR, because it would somehow introduce a hidden dependency (e.g. if tm4e renames the class, the log messages will reappear).

So I think what should also work is (I didn't test this):

Logger.getLogger("org.eclipse.tm4e.core.internal.oniguruma.OnigRegExp").setLevel(Level.SEVERE);

Copy link
Member

Choose a reason for hiding this comment

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

I think for now we should do Logger.getLogger("org.eclipse.tm4e.core.internal.oniguruma.OnigRegExp").setLevel(Level.SEVERE); as not to affect the logging level of the whole system as there are lots of other pieces in play.

I have another task of reviewing logging (in context of eclipse-platform/eclipse.platform.releng.aggregator#588 (comment) / eclipse-packaging/packages#27)

Copy link
Member

Choose a reason for hiding this comment

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

Raised #101

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I created a PR: #102

@ddscharfe
Copy link
Contributor Author

@jonahgraham @ghentschke it looks like this is not working (anymore).
One reason is that the target platform is not updated (we need org.eclipse.tm4e.core:0.5.4), but to make it work again, I also have to revert the change from #102.
Can anyone confirm this?

@ghentschke
Copy link
Contributor

I've noticed as well that it's not working anymore but have not investigated this issue.

@ddscharfe
Copy link
Contributor Author

I've noticed as well that it's not working anymore but have not investigated this issue.

Okay, I'll investigate it

@ddscharfe
Copy link
Contributor Author

The logger gets garbage collected and a new one is created on demand, which will then have a different level. See #146.

@jonahgraham jonahgraham added this to the 1.0.0 milestone Sep 18, 2023
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.

3 participants
0