x10.util
Class LogHandler

java.lang.Object
  extended byx10.util.LogHandler

public class LogHandler
extends java.lang.Object

LogHandler provides a simple, standard api for handling logging of application events. The properties to configure this object are given by the x10/util/LogHandler.ini file. By default, this file should contain:

# Set LogLevel from 0 to 5:
# 0: No Logging
# 1: Exception Logging
# 2: Transmission Logging
# 3: Currently Unused
# 4: Currently Unused
# 5: Currently Unused
#
# LogLevel is additive.
LogLevel=2

# LogFile specifies a path and filename to use for logging purposes.
# By not specifying a LogFile, the LogHandler will default to stdout.
LogFile=


Method Summary
static LogHandler getLogHandler()
          getLogHandler obtains the system's singleton LogHandler that is shared by all systems.
 void log(java.lang.Exception exception, int minimumLevel)
          log outputs the stack trace of the pecified exception to the log.
 void log(java.lang.String message, int minimumLevel)
          log outputs the specified message to the log.
static void logException(java.lang.Exception exception, int minimumLevel)
          logException outputs the stack trace of the pecified exception to the log.
static void logMessage(java.lang.String message, int minimumLevel)
          logMessage outputs the specified message to the log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

log

public void log(java.lang.String message,
                int minimumLevel)
log outputs the specified message to the log.

Parameters:
message - - the message to log
minimumLevel - - the minimum log level that must be set for this message to actually be logged.

log

public void log(java.lang.Exception exception,
                int minimumLevel)
log outputs the stack trace of the pecified exception to the log.

Parameters:
exception - - the exception to log the stack trace of.
minimumLevel - - the minimum log level that must be set for this exception to actually be logged.

getLogHandler

public static LogHandler getLogHandler()
getLogHandler obtains the system's singleton LogHandler that is shared by all systems.

Returns:
LogHandler the system's log handler

logMessage

public static void logMessage(java.lang.String message,
                              int minimumLevel)
logMessage outputs the specified message to the log.

Parameters:
message - - the message to log
minimumLevel - - the minimum log level that must be set for this message to actually be logged.

logException

public static void logException(java.lang.Exception exception,
                                int minimumLevel)
logException outputs the stack trace of the pecified exception to the log.

Parameters:
exception - - the exception to log the stack trace of.
minimumLevel - - the minimum log level that must be set for this exception to actually be logged.


Copyright ©2000-2005 Wade Wassenberg.
On the web: http://x10.homelinux.org.
Send bug reports to x10@wass.homelinux.net.
Last Modified June 1, 2005