-
Notifications
You must be signed in to change notification settings - Fork 112
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
Provide static acessors in the ILog interface as an alternative to Platform #498
Provide static acessors in the ILog interface as an alternative to Platform #498
Conversation
e39cd16
to
be93f2c
Compare
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 like the overall idea.
This also reminds me of #33 and I think if we add two new API methods we should add another argument-less convenient method get()
or ofContext()
or alike.
runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/ILog.java
Outdated
Show resolved
Hide resolved
be93f2c
to
ee3e05c
Compare
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.
Looks good for me. Just a few minor remarks below.
Since the last time it was quite a controversial topic I think it would be good to get some more feedback from others.
@@ -922,7 +922,7 @@ public static long getStateStamp() { | |||
* @since 3.0 | |||
*/ | |||
public static ILog getLog(Bundle bundle) { |
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 a comment mentioning the new method would be good here and below.
Eventually this method should at least be deprecated.
@@ -132,4 +134,45 @@ default void error(String message) { | |||
default void error(String message, Throwable throwable) { | |||
log(new Status(IStatus.ERROR, getBundle().getSymbolicName(), message, throwable)); | |||
} | |||
|
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.
Not it that it really matters, but I have the impression that usually such static factories methods are added at the top of the file instead of the bottom.
LGTM |
Currently one obtains ILog either by injection/di or a static call to Platform.getLog(...)., but is is more semantic to only use ILog interface and also decreases the coupling of the code to a central singleton class.
ee3e05c
to
1431e56
Compare
Currently one obtains ILog either by injection/di or a static call to Platform.getLog(...)., but is is more semantic to only use ILog interface and also decreases the coupling of the code to a central singleton class.
This is similar to the recent changes in IPath and will also help in decreasing the need to call
Platform.getXXX
methods so we can easier adapt for changes here especially in the context of eclipse-equinox/equinox#253.A next step would to to replace references, and possibly moving
ILog
to equinox common to reduce the amount of split package classes.