Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Efxclipse/Runtime/Recipes"

(Usage)
(Usage)
Line 15: Line 15:
 
There are different ways to use get a logger.
 
There are different ways to use get a logger.
  
==== Logger Factory ====
+
==== LoggerCreator ====
  
This is the easiest way to use the logger
+
If you are running on OSGi you can add the <code>org.eclipse.fx.osgi.util</code> bundle which provides access to the <code>LoggerCreator</code> factory class
  
 
<source lang="java">
 
<source lang="java">
 +
private org.eclipse.fx.core.log.Logger;
 +
private org.eclipse.fx.osgi.util.LoggerCreator;
 +
 +
public class MyClass {
 +
  private static Logger LOGGER = LoggerCreator.createLogger(MyClass.class);
 +
 +
  // ....
 +
}
 
</source>
 
</source>
  
 
== DI ==
 
== DI ==

Revision as of 17:07, 6 December 2013

This page holds best practice recipes when writing JavaFX application using e(fx)clipse

Core

Logging

e(fx)clipse has its own logging facade org.eclipse.fx.core.log.Logger which allows to plug-in different log frameworks.

Currently available are:

  • java.util.Logging (default)
  • log4j by adding org.eclipse.fx.core.log4j

Usage

There are different ways to use get a logger.

LoggerCreator

If you are running on OSGi you can add the org.eclipse.fx.osgi.util bundle which provides access to the LoggerCreator factory class

private org.eclipse.fx.core.log.Logger;
private org.eclipse.fx.osgi.util.LoggerCreator;
 
public class MyClass {
  private static Logger LOGGER = LoggerCreator.createLogger(MyClass.class);
 
  // ....
}

DI

Back to the top