net.sourceforge.groboutils.autodoc.v1.log4j
Class Log4jLog

java.lang.Object
  extended bynet.sourceforge.groboutils.autodoc.v1.log4j.Log4jLog
All Implemented Interfaces:
AutoDocLog

public class Log4jLog
extends java.lang.Object
implements AutoDocLog

An interface for logging. This allows for an abstraction between the owning class and any underlying logging mechanism desired.

The actual meaning of the logging levels is implementation independent.

Since:
March 16, 2002
Version:
$Date: 2003/02/10 22:52:12 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
Log4jLog(java.lang.Class owner)
          Standard constructor - uses the Logger based on the given class.
Log4jLog(org.apache.log4j.Logger log)
          Create a log interface based on the given Apache Logger.
 
Method Summary
protected  java.lang.Object concatMessage(java.lang.Object[] o)
          Concatenate the given array into a single string.
 void debug(java.lang.Object message)
           
 void debug(java.lang.Object[] message)
           
 void debug(java.lang.Object[] message, java.lang.Throwable error)
           
 void debug(java.lang.Object message, java.lang.Throwable error)
           
 void info(java.lang.Object message)
           
 void info(java.lang.Object[] message)
           
 void info(java.lang.Object[] message, java.lang.Throwable error)
           
 void info(java.lang.Object message, java.lang.Throwable error)
           
protected  void setLog(org.apache.log4j.Logger log)
          Sets the internal log instance.
 void warn(java.lang.Object message)
           
 void warn(java.lang.Object[] message)
           
 void warn(java.lang.Object[] message, java.lang.Throwable error)
           
 void warn(java.lang.Object message, java.lang.Throwable error)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jLog

public Log4jLog(java.lang.Class owner)
Standard constructor - uses the Logger based on the given class.

Parameters:
owner - the owning class to assign log responsibility to. Must not be null.
Throws:
java.lang.IllegalArgumentException - if owner is null.

Log4jLog

public Log4jLog(org.apache.log4j.Logger log)
Create a log interface based on the given Apache Logger.

Parameters:
log - the underlying log instance to use for logging. Must not be null.
Throws:
java.lang.IllegalArgumentException - if owner is null.
Method Detail

debug

public void debug(java.lang.Object message)
Specified by:
debug in interface AutoDocLog

debug

public void debug(java.lang.Object[] message)
Specified by:
debug in interface AutoDocLog

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable error)
Specified by:
debug in interface AutoDocLog

debug

public void debug(java.lang.Object[] message,
                  java.lang.Throwable error)
Specified by:
debug in interface AutoDocLog

info

public void info(java.lang.Object message)
Specified by:
info in interface AutoDocLog

info

public void info(java.lang.Object[] message)
Specified by:
info in interface AutoDocLog

info

public void info(java.lang.Object message,
                 java.lang.Throwable error)
Specified by:
info in interface AutoDocLog

info

public void info(java.lang.Object[] message,
                 java.lang.Throwable error)
Specified by:
info in interface AutoDocLog

warn

public void warn(java.lang.Object message)
Specified by:
warn in interface AutoDocLog

warn

public void warn(java.lang.Object[] message)
Specified by:
warn in interface AutoDocLog

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable error)
Specified by:
warn in interface AutoDocLog

warn

public void warn(java.lang.Object[] message,
                 java.lang.Throwable error)
Specified by:
warn in interface AutoDocLog

concatMessage

protected java.lang.Object concatMessage(java.lang.Object[] o)
Concatenate the given array into a single string. The returned object will be of type java.lang.StringBuffer or java.lang.String; use toString() on the resulting object.

Parameters:
o - an array (possibly null) of objects (possibly null) to concatenate their toString() results together.
Returns:
the concatenated message.
See Also:
StringBuffer

setLog

protected void setLog(org.apache.log4j.Logger log)
Sets the internal log instance.

Parameters:
log - the log to set. It must not be null.
Throws:
java.lang.IllegalArgumentException - if log is null.


Copyright © 2001-2003 by The GroboUtils Project