Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Error Log and console output
Error Log and console output [message #756297] Fri, 11 November 2011 20:03 Go to next message
Lucy Sakhnenko is currently offline Lucy SakhnenkoFriend
Messages: 41
Registered: March 2011
Member
Hi,

I'm sending the exceptions of my plugin to the Error Log. This is an example built from the "Hello World" sample puging project:

	@SuppressWarnings("null")
	public void run(IAction action) {
		MessageDialog.openInformation(
			window.getShell(),
			"Test",
			"Hello, Eclipse world");
		
		Bundle bundle = Platform.getBundle(Platform.PI_RUNTIME);
		ILog log = Platform.getLog(bundle);
		Object o = null;
		try {
			o.equals("sk");
		} catch (Exception e) {
			log.log(new Status(Status.ERROR, "MyPI", "test", e));
		}
		
	}


Everything works fine, but the exception keeps showing up in the Eclipse console:

!ENTRY MyPI 4 0 2011-11-11 15:36:23.116
!MESSAGE test
!STACK 0
java.lang.NullPointerException
	at test.actions.SampleAction.run(SampleAction.java:50)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
        ...


I was hoping to not see the exception written in the console anymore.

Is this how it is supposed to work or I am doing something wrong?

Thanks!



Re: Error Log and console output [message #757349 is a reply to message #756297] Thu, 17 November 2011 20:47 Go to previous message
Mark Walters is currently offline Mark WaltersFriend
Messages: 25
Registered: June 2011
Junior Member
Hi,
perhaps you are starting eclipse with -consoleLog. The docs imply this:
http://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_logging_facility%3F

Ta,
Mark.
Previous Topic:Connecting IOConsole to an invoked Process
Next Topic:PluginRegistry.getActiveModels() doesn't work properly
Goto Forum:
  


Current Time: Thu Jul 19 06:07:56 GMT 2018

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

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

Back to the top