methusalah / OpenRTS

Real-Time Strategy game 3D engine coded in pure java
MIT License
1.33k stars 151 forks source link

correct Logging #86

Closed meltzow closed 9 years ago

meltzow commented 9 years ago

see here http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:logging

normally all files/components gets his own logger. Because of this we can enable and disable specific parts/components for logging in more details. For example info - logging while loading the Map or GUI.

change the logging without change the source code can be handled with "logging.properties". I am not sure, if the file is read automatically. if not we can read it in source code.

meltzow commented 9 years ago

example code for reading the logging properties

Properties preferences = new Properties();
try {
    FileInputStream configFile = new FileInputStream("/path/to/app.properties");
    preferences.load(configFile);
    LogManager.getLogManager().readConfiguration(configFile);
} catch (IOException ex)
{
    System.out.println("WARNING: Could not open configuration file");
    System.out.println("WARNING: Logging not configured (console output only)");
}

and example logging.properties is now commited

meltzow commented 9 years ago

fixed now. The logUtil is removed.