-
Notifications
You must be signed in to change notification settings - Fork 114
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
Update of the FAQ Log entry #1623
Update of the FAQ Log entry #1623
Conversation
c1a586d
to
715490c
Compare
@HannesWell WDTY? @thahnen FYI, we like to see more PR from you (also code related if you find the time). |
715490c
to
7ea6b8b
Compare
... | ||
public static void test(){ | ||
try { | ||
log("Eclipse Style Logging"); | ||
ILog.get().info("Starting"); |
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.
Maybe it's not a good idea to use tabs.
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.
Should be resolved
7ea6b8b
to
f1c8ca0
Compare
try { | ||
log("Eclipse Style Logging"); | ||
// do something that may cause an exception | ||
} | ||
catch(Exception e){ |
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.
Nit.
catch(Exception e){ | |
catch (Exception e){ |
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.
Changed
Lets promote ILog.get() instead Platform.getLog():
f1c8ca0
to
ba30f2d
Compare
Ignoring freeze as this is only online documentation |
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.
Thanks. I personally also prefer the new code.
I just wonder if the example should be put in a markdown code block wrapped in three back-ticks.
You can write any kind of IStatus object to the log file, including a MultiStatus if you have hierarchies of information to display. If you create your own subclass of the utility class Status, you can override the getMessage method to return extra information to be displayed in the log file. Many plug-ins add utility classes for writing messages and errors to the log: | ||
|
||
import org.eclipse.core.runtime.Status; | ||
import org.eclipse.core.runtime.ILog; | ||
... | ||
public class MyLogger { | ||
... | ||
private static final Bundle BUNDLE = FrameworkUtil.getBundle(MyLogger.class); |
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.
Is this line still necessary?
At least while viewing this on the phone I can't see a reference.
Lets promote ILog.get() instead Platform.getLog():