Back to DevDoc
SimExplorer Coding Guidelines
Committing
When you commit modified sources, please ensure that:
- your code compiles
- unit tests passes
- you specify a usefull message describing the changeset, if necessary by adding one of following tags:
- API: notice a change in API (suppression or architecture modification). Pay attention to point out some justification of the modification.
- BUGFIX: fix a bug, please add a link to the ticket ID (with a #)
- NEW: new feature added
Logging
The best method to log message during the exécution is to used the Java Logging facilities.
You can find an example in this class. Remarquable points are:
- a constant variable store the logger instance to avoid overhead in case of intensive use (line 55):
public static final Logger LOGGER = Logger.getLogger(IDEModularApplicationPackager.class.getName());
Just replace IDEModularApplicationPackager by the class enclosing your code. - use the correct level, according to the severity and the verbosity (use FINER and FINEST for high verbosity)
- if message displaying could be time consumer, you can enclose your logging block by a test on the logger with the method isLoggable.
Loggers management
- You can enable or disable logging of SimExplorer by setting the property org.simexplorer.level to the desired level.
- In the IDE, for setting the logging levels in developpement environnement, you have to edit the run.args.extra property in the file platform.properties, for each level with the syntax -J-Dorg.company.package.level=LEVEL.
Some hints:
- Meta-Inf Services Lookup discovering can be verbose by activating the property -J-Dorg.openide.util.lookup.MetaInfServicesLookup.level=ALL. It's off for instance because it caused an annoying pop-up, related to #33.
See also the ticket #60





