From: Erik V. <eri...@hc...> - 2007-01-12 23:26:21
|
I have implemented log4j logging throughout. Most System.out.println() statements have been replaced by log.debug(). There are two "appenders" (i.e. log message destinations): the console and a daily rolling log file. The log file logs everything and includes time stamps and other details. The console does not get "debug"-level messages and has less detail. To avoid confusion, I have renamed the Log Window to Report Window, because it holds what can best be described as the game report (I would like to add Print and Save buttons to this window). The lines added to this window are also logged (level INFO), as well as all messages sent to the UI. There is a new properties file called "my.properties", which is intended to hold the user's local preferences (in so far these are not configurable by some screen). Currently this file only holds the SVG/GIF tile preference, and the log4j properties. One of the log4j properties is the log file path; the default is log/18xx.log. The new class util.Config reads my.properties into a Properties map. Any class can retrieve any property with the Config.get() method. Other property files can easily be added. I have changed ImageLoader to use the GIF/SVG preference. If the preferred type (SVG is default) is not found, the other type is looked for. This class was also changed to consistently use Util.getStreamForFile(). This method looks first at the file system and, if a tile (or whatever else - it is also used to find XML files) is not found there, into the Rails jar (incl. version number). Jar file log4j-1.2.14.jar has been added to the lib directory and must be added to the project's build path. Comments welcome, as usual. Erik Vos |