com.sibvisions.util.log.log4j
Class Log4jLogger

java.lang.Object
  extended by com.sibvisions.util.log.log4j.Log4jLogger
All Implemented Interfaces:
ILogger

public class Log4jLogger
extends java.lang.Object
implements ILogger

The Log4jLogger is the ILogger implementation for log4j.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sibvisions.util.log.ILogger
ILogger.LogLevel
 
Constructor Summary
Log4jLogger(java.lang.String pName)
          Creates a new instance of Log4jLogger.
 
Method Summary
 void debug(java.lang.Object... info)
          Logs information with ILogger.LogLevel.DEBUG.
 void error(java.lang.Object... info)
          Logs information with ILogger.LogLevel.ERROR.
 ILogger.LogLevel getLevel()
          Gets the log level.
 java.lang.String getName()
          Gets the logger name.
 void info(java.lang.Object... info)
          Logs information with ILogger.LogLevel.INFO.
 boolean isEnabled(ILogger.LogLevel pLevel)
          Checks if the current log level is enabled/allowed to log.
 boolean isLevelSet()
          Gets whether the log level is set or used from a parent logger.
 void setLevel(ILogger.LogLevel pLevel)
          Sets the log level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jLogger

public Log4jLogger(java.lang.String pName)
Creates a new instance of Log4jLogger.

Parameters:
pName - the name for the logger (the class name is recommended)
Method Detail

getName

public java.lang.String getName()
Gets the logger name.

Specified by:
getName in interface ILogger
Returns:
the name

setLevel

public void setLevel(ILogger.LogLevel pLevel)
Sets the log level.

Specified by:
setLevel in interface ILogger
Parameters:
pLevel - the log level

isLevelSet

public boolean isLevelSet()
Gets whether the log level is set or used from a parent logger.

Specified by:
isLevelSet in interface ILogger
Returns:
true if the logger has its own log level

getLevel

public ILogger.LogLevel getLevel()
Gets the log level.

Specified by:
getLevel in interface ILogger
Returns:
the log level

debug

public void debug(java.lang.Object... info)
Logs information with ILogger.LogLevel.DEBUG.

Specified by:
debug in interface ILogger
Parameters:
info - any log information

info

public void info(java.lang.Object... info)
Logs information with ILogger.LogLevel.INFO.

Specified by:
info in interface ILogger
Parameters:
info - any log information

error

public void error(java.lang.Object... info)
Logs information with ILogger.LogLevel.ERROR.

Specified by:
error in interface ILogger
Parameters:
info - any log information

isEnabled

public boolean isEnabled(ILogger.LogLevel pLevel)
Checks if the current log level is enabled/allowed to log.

Specified by:
isEnabled in interface ILogger
Parameters:
pLevel - the log level to check
Returns:
true if the log level is allowed to log


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.