net.sf.zekr.engine.log
Class Logger

java.lang.Object
  extended by net.sf.zekr.engine.log.Logger

public class Logger
extends java.lang.Object

Zekr default logger wrapper class for Log4J library. This is not a singleton class. It creates a new instance of itself per each call to getInstance(), because different classes should have different Log4J loggers associated with.

Since:
Zekr 1.0
Author:
Mohsen Saboorian

Field Summary
static org.apache.log4j.Level DEBUG
           
static org.apache.log4j.Level ERROR
           
static org.apache.log4j.Level FATAL
           
static org.apache.log4j.Level INFO
           
static java.lang.String LOG_FILE_PATH
           
static org.apache.log4j.Level WARN
           
 
Method Summary
 void debug(java.lang.Object msg)
           
 void doFatal(java.lang.Throwable th)
          A call to this method will first log the Throwable error, and then exits the virtual machine with 1 error status.
 void error(java.lang.Object msg)
           
 void error(java.lang.Object msg, java.lang.Throwable th)
           
 void fatal(java.lang.Object msg)
           
static Logger getLogger(java.lang.Class theClass)
          For logging more precisely by implying the class name from which log message is sent.
 void implicitLog(java.lang.Throwable th)
           
 void info(java.lang.Object msg)
           
 void log(org.apache.log4j.Level level, java.lang.Object msg)
           
 void log(java.lang.Object msg)
          This method logs msg.toString() if msg is not of type Throwable (exception).
 void memInfo()
          Log (info level) memory info.
 void warn(java.lang.Object msg)
           
 void warn(java.lang.Object msg, java.lang.Throwable th)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFO

public static final org.apache.log4j.Level INFO

DEBUG

public static final org.apache.log4j.Level DEBUG

WARN

public static final org.apache.log4j.Level WARN

ERROR

public static final org.apache.log4j.Level ERROR

FATAL

public static final org.apache.log4j.Level FATAL

LOG_FILE_PATH

public static final java.lang.String LOG_FILE_PATH
Method Detail

getLogger

public static final Logger getLogger(java.lang.Class theClass)
For logging more precisely by implying the class name from which log message is sent.

Parameters:
theClass - logging source class
Returns:
corresponding logger

info

public final void info(java.lang.Object msg)

memInfo

public final void memInfo()
Log (info level) memory info.


debug

public final void debug(java.lang.Object msg)

warn

public final void warn(java.lang.Object msg)

warn

public final void warn(java.lang.Object msg,
                       java.lang.Throwable th)

error

public final void error(java.lang.Object msg)

error

public final void error(java.lang.Object msg,
                        java.lang.Throwable th)

fatal

public final void fatal(java.lang.Object msg)

log

public final void log(java.lang.Object msg)
This method logs msg.toString() if msg is not of type Throwable (exception). If the msg is in fact a Throwable object, it logs it as an error message implicitly. Then if ApplicationConfig.isFullyInitialized(), it brings up an error dialog and show the exception to user.

Parameters:
msg - any object of type String or Throwable

implicitLog

public final void implicitLog(java.lang.Throwable th)

log

public final void log(org.apache.log4j.Level level,
                      java.lang.Object msg)

doFatal

public void doFatal(java.lang.Throwable th)
A call to this method will first log the Throwable error, and then exits the virtual machine with 1 error status.

Parameters:
th - throwable object