org.objectweb.util.monolog.lib
Class LoggableImpl

java.lang.Object
  extended by org.objectweb.util.monolog.lib.LoggableImpl
All Implemented Interfaces:
Loggable

public class LoggableImpl
extends java.lang.Object
implements Loggable

This class is a basic implementation of Loggable interface. This class holds reference to the logger and the logger factory.

Author:
S.Chassande-Barrioz

Field Summary
protected  boolean debug
           
protected  Logger logger
           
protected  LoggerFactory loggerFactory
           
 
Constructor Summary
LoggableImpl()
           
 
Method Summary
 void assignLogger(java.lang.Object o)
          Assign the current logger and the current loggerFactory to an object or to each element if o is a structure.
 void assignLogger(java.lang.Object o, Logger l)
          Assign a logger and the current loggerFactory to an object or to each element if o is a structure.
 java.lang.String getExpectedLoggerName()
           
 Logger getLogger()
          Retrieves the logger instance used
 LoggerFactory getLoggerFactory()
          Retrieves the logger factory instance used
 java.lang.String getLoggerName()
           
 java.lang.String getLoggerNameSuffix()
           
 boolean isDebug()
          Indicates if the DEBUG level is enabled for the current logger.
 void setLogger(Logger l)
          Assigns the logger instance to use
 void setLoggerFactory(LoggerFactory lf)
          Assigns the logger factory instance to use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug

logger

protected Logger logger

loggerFactory

protected LoggerFactory loggerFactory
Constructor Detail

LoggableImpl

public LoggableImpl()
Method Detail

getLogger

public Logger getLogger()
Description copied from interface: Loggable
Retrieves the logger instance used

Specified by:
getLogger in interface Loggable

getLoggerFactory

public LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Retrieves the logger factory instance used

Specified by:
getLoggerFactory in interface Loggable

setLogger

public void setLogger(Logger l)
Description copied from interface: Loggable
Assigns the logger instance to use

Specified by:
setLogger in interface Loggable

setLoggerFactory

public void setLoggerFactory(LoggerFactory lf)
Description copied from interface: Loggable
Assigns the logger factory instance to use

Specified by:
setLoggerFactory in interface Loggable

getLoggerName

public java.lang.String getLoggerName()

getExpectedLoggerName

public java.lang.String getExpectedLoggerName()
Returns:
a string defining the expected name of the logger. By default this method retrieves a null value meaning that no particular name is expected for the logger. Typically this method has to be override in order to specify an expected logger name if wanted.

getLoggerNameSuffix

public java.lang.String getLoggerNameSuffix()
Returns:
a string defining a suffix of the expected name of the logger. logger.name = logger.name + "." + suffix

isDebug

public boolean isDebug()
Indicates if the DEBUG level is enabled for the current logger.


assignLogger

public void assignLogger(java.lang.Object o)
Assign the current logger and the current loggerFactory to an object or to each element if o is a structure. This method supports three structures: Map, Collection and Array.


assignLogger

public void assignLogger(java.lang.Object o,
                         Logger l)
Assign a logger and the current loggerFactory to an object or to each element if o is a structure. This method supports three structures: Map, Collection and Array.