jme.utility
Class LoggingSystem

java.lang.Object
  extended byjme.utility.LoggingSystem

public class LoggingSystem
extends java.lang.Object

LoggingSystem maintains a system for logging using the Logging API in JDK 1.4 and higher. LoggingSystem is a singleton and is created via the getLoggingSystem method. This initializes a default logger that can be retrieved via the getLogger method. The logger object is final so can not be directly altered. To change the attributes of the logger, use the built in methods in LoggingSystem. Once the LoggingSystem is created, the logging object can be used normally.

Version:
0.1.0
Author:
Mark Powell
See Also:
Logger

Method Summary
 java.util.logging.Logger getLogger()
          getLogger returns the logger object maintained by the LoggingSystem.
static LoggingSystem getLoggingSystem()
          getLoggingSystem is the entry point for the LoggingSystem class.
 void setFormatter(java.util.logging.Formatter formatter)
          setFormatter sets the formatter to use for this logger.
 void setHandler(java.util.logging.Handler handler)
          setHandler sets the Handler of the logger.
 void setLevel(java.util.logging.Level level)
          setLevel sets the filtering level to be used for this logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogger

public java.util.logging.Logger getLogger()
getLogger returns the logger object maintained by the LoggingSystem. This reference is null until the LoggingSystem is initialized with a call to getLoggingSystem.

Returns:
logger the logging object.

setHandler

public void setHandler(java.util.logging.Handler handler)
setHandler sets the Handler of the logger. By default the Handler is a simple FileHandler that writes to debug.txt.

Parameters:
handler - the new handler to use for log handling.

setLevel

public void setLevel(java.util.logging.Level level)
setLevel sets the filtering level to be used for this logger. By default it is set to ALL.

Parameters:
level - the new level to set the logger to.

setFormatter

public void setFormatter(java.util.logging.Formatter formatter)
setFormatter sets the formatter to use for this logger. By default it is set to simple formatter.

Parameters:
formatter - the new formatter to use for the logger.

getLoggingSystem

public static LoggingSystem getLoggingSystem()
getLoggingSystem is the entry point for the LoggingSystem class. This creates a new LoggingSystem object if need be, or returns the reference if one is already created.

Returns:
the singleton reference to the LoggingSystem