Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Logging and reporting errors
Logging and reporting errors [message #216993] Wed, 20 June 2007 14:27 Go to next message
Eclipse UserFriend
Originally posted by: lario*NOSPAM*.inherit.com

When writing a new plugin. What is the recommend method for logging and
reporting errors in a runtime environment? Can you direct me to example
code showing how to do this?



Thanks
Re: Logging and reporting errors [message #217004 is a reply to message #216993] Wed, 20 June 2007 15:05 Go to previous message
Eclipse UserFriend
Originally posted by: jacek.pospychala.pl.ibm.com

Robert,
there are actually two ways, depending how detailed information you want
to log.
One is for debugging, best for storing very detailed information, that
you wouldn't normally want to keep, but sometimes
it may be useful if your users encounter problems in software. They will
be able to enable debugging with special configuration
options. Details are here:
http://wiki.eclipse.org/index.php/FAQ_How_do_I_use_the_platf orm_debug_tracing_facility%3F

Logging and error handling used for notifying user about events in your
application is provided by Status handing mechanism.
Please read following FAQ entry for more details:
http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_statushandling.htm
The main idea is to create IStatus items whenever you detect some
errorous condition and either throw them to be handled by someone else,
or handle it immediatelly by yourself, by calling
StatusManager.handle(IStatus). Here you can add some hints, how the
status should be
handled, either logged or displayed to user. You can also define custom
status handler to change the standard way the errors are handled.

Good side is that, often when you receive Eclipse exceptions, like
CoreException, it already has it's status (CoreException.getStatus())
so you often do like this:

try {
dangerous.rick();
} catch (CoreException e) {
StatusManager.getManager().handle(e.getStatus(), StatusManager.SHOW);
}

Robert Lario wrote:
> When writing a new plugin. What is the recommend method for logging and
> reporting errors in a runtime environment? Can you direct me to example
> code showing how to do this?
>
>
>
> Thanks
>
>
>
Previous Topic:Accessing the Oracle source for BIRT Report Design.
Next Topic:'X' in tab disappears; bad design!
Goto Forum:
  


Current Time: Sat Apr 27 03:34:35 GMT 2024

Powered by FUDForum. Page generated in 0.07769 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top