com.jme.util
Class LoggingSystem

java.lang.Object
  extended bycom.jme.util.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:
$Id: LoggingSystem.java,v 1.3 2004/04/22 22:27:09 renanse Exp $
Author:
Mark Powell
See Also:
Logger

Method Summary
static 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 loggerOn(boolean value)
          loggerOn turns the logger on and off.
 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 static 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.

loggerOn

public void loggerOn(boolean value)
loggerOn turns the logger on and off. If true is passed the filter level is set to fine allowing all message to display, false filters all messages.

Parameters:
value - true allows messages to display, false does not.

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