-
Notifications
You must be signed in to change notification settings - Fork 13
[#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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Note that this requires org.eclipse.tm4e.core:0.5.4. So until the target platform is updated this will have no effect. |
@@ -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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised #101
There was a problem hiding this comment.
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
@jonahgraham @ghentschke it looks like this is not working (anymore). |
I've noticed as well that it's not working anymore but have not investigated this issue. |
Okay, I'll investigate it |
The logger gets garbage collected and a new one is created on demand, which will then have a different level. See #146. |
Fixes issue #88