Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

E4/EAS/Logging and Tracing

< E4‎ | EAS
Revision as of 16:06, 24 October 2009 by Unnamed Poltroon (Talk)

Components are going to want a way to send information into a log somewhere. This needs to be pluggable so that they can contain and dictate where this information should go and how it should be logged. Ideally, the default output of what e4 applications produce should be consumable by the 'Error Log' view from Eclipse 3.x. It should also be possible for applications to enable tracing.

This service is related to status handling.

Eclipse 3.x API

Logging:

  • org.osgi.service.log.LogService
  • org.eclipse.core.runtime.ILog

Tracing:

  • org.eclipse.core.runtime.Platform.getDebugOption(String)

Retrieving LogService in 3.x

A developer can retrieve the OSGi LogService via a ServiceTracker.

private LogService getLogService() {
  fLogServiceTracker = new ServiceTracker(fBundleContext, LogService.class.getName(), null);
  return (LogService) fLogServiceTracker.getService();
}

e4 (Java)

Logging:

  • org.eclipse.e4.core.services.Logger

Retrieving LogService in e4 (Java)

A developer can retrieve the OSGi LogService via a ServiceTracker as described above or they can query their Eclipse context for it.

private LogService getLogService() {
  return (LogService) fEclipseContext.get(LogService.class.getName());
}

Back to the top