logging
Class AbstractLog4jLog

java.lang.Object
  extended by logging.AbstractLog4jLog
All Implemented Interfaces:
Log
Direct Known Subclasses:
FileLog

public abstract class AbstractLog4jLog
extends java.lang.Object
implements Log

This is the logging service implementation for compatibility between JAP logging style and log4j logging style. So it should be no problem to use log4j also in JAP.


Constructor Summary
AbstractLog4jLog()
           
 
Method Summary
protected abstract  org.apache.log4j.Logger getLogger()
           
 int getLogLevel()
          The current log level.
 int getLogType()
          This method is needed for the implementation of the Log interface, but isn't supported by this class.
 void log(int a_level, int a_type, java.lang.String a_message)
          Logs a message to the infoservice logging output.
 void setLogLevel(int level)
          Set the log level of this log instance.
 void setLogType(int a_type)
          This method is needed for the implementation of the Log interface, but isn't supported by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLog4jLog

public AbstractLog4jLog()
Method Detail

getLogger

protected abstract org.apache.log4j.Logger getLogger()

log

public void log(int a_level,
                int a_type,
                java.lang.String a_message)
Logs a message to the infoservice logging output.

Specified by:
log in interface Log
Parameters:
a_level - The level of the message. See logging.LogLevel for more information. Because we are using log4j, there are done some transformations: LogLevel.DEBUG -> Level.DEBUG LogLevel.INFO , LogLevel.NOTICE -> Level.INFO LogLevel.WARNING -> Level.WARN LogLevel.ERR , LogLevel.EXCEPTION -> Level.ERROR LogLevel.ALERT , LogLevel.EMERGENCY -> Level.FATAL
a_type - The type of the message, see logging.LogType. This value is ignored, because the infoservice doesn't use typed messaged, so everything is logged.
a_message - The message to log.

setLogType

public void setLogType(int a_type)
This method is needed for the implementation of the Log interface, but isn't supported by this class. So calls of this method are ignored.

Specified by:
setLogType in interface Log
Parameters:
a_type - The debug type (NUL, GUI, NET, THREAD, MISC)

getLogType

public int getLogType()
This method is needed for the implementation of the Log interface, but isn't supported by this class. So always LogType.ALL is returned.

Specified by:
getLogType in interface Log
Returns:
LogType.ALL, because the method isn't supported by this class.

setLogLevel

public void setLogLevel(int level)
Set the log level of this log instance. Because we are using log4j, there are done some transformations: LogLevel.DEBUG -> Level.DEBUG LogLevel.INFO , LogLevel.NOTICE -> Level.INFO LogLevel.WARNING -> Level.WARN LogLevel.ERR , LogLevel.EXCEPTION -> Level.ERROR LogLevel.ALERT , LogLevel.EMERGENCY -> Level.FATAL

Specified by:
setLogLevel in interface Log
Parameters:
a_level - Changes the log level. Only messages with a equal or higher priority are logged.

getLogLevel

public int getLogLevel()
The current log level.

Specified by:
getLogLevel in interface Log
Returns:
The current log level.