autohit.common.traps
Class CommonsLoggerTrap

java.lang.Object
  extended byautohit.common.traps.CommonsLoggerTrap
All Implemented Interfaces:
org.apache.commons.logging.Log

public final class CommonsLoggerTrap
extends java.lang.Object
implements org.apache.commons.logging.Log

Traps Commons logging. You must call the static method setTrap() at least once per JVM to get this working.

Version:
1.0 Version History EPG - Initial - 19Jul03
Author:
Erich P. Gatejen

Constructor Summary
CommonsLoggerTrap(java.lang.String name)
          Constructor
 
Method Summary
 void debug(java.lang.Object message)
          Log a message with debug log level.
 void debug(java.lang.Object message, java.lang.Throwable exception)
          Log a message and exception with debug log level.
 void error(java.lang.Object message)
          Log a message with error log level.
 void error(java.lang.Object message, java.lang.Throwable exception)
          Log a message and exception with error log level.
 void fatal(java.lang.Object message)
          Log a message with fatal log level.
 void fatal(java.lang.Object message, java.lang.Throwable exception)
          Log a message and exception with fatal log level.
 void info(java.lang.Object message)
          Log a message with info log level.
 void info(java.lang.Object message, java.lang.Throwable exception)
          Log a message and exception with info log level.
 boolean isDebugEnabled()
          Is debug logging currently enabled?
 boolean isErrorEnabled()
          Is error logging currently enabled?
 boolean isFatalEnabled()
          Is fatal logging currently enabled?
 boolean isInfoEnabled()
          Is info logging currently enabled?
 boolean isTraceEnabled()
          Is tace logging currently enabled?
 boolean isWarnEnabled()
          Is warning logging currently enabled?
static void setTrap(AutohitLogInjectorWrapper logger)
          Log a message with debug log level.
 void trace(java.lang.Object message)
          Log a message with trace log level.
 void trace(java.lang.Object message, java.lang.Throwable exception)
          Log a message and exception with trace log level.
 void warn(java.lang.Object message)
          Log a message with warn log level.
 void warn(java.lang.Object message, java.lang.Throwable exception)
          Log a message and exception with warn log level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsLoggerTrap

public CommonsLoggerTrap(java.lang.String name)
Constructor

Parameters:
name - Name of the logger to be constructed
Method Detail

setTrap

public static void setTrap(AutohitLogInjectorWrapper logger)
Log a message with debug log level.

Parameters:
logger - a logger in which to dump everything.

debug

public void debug(java.lang.Object message)
Log a message with debug log level.

Specified by:
debug in interface org.apache.commons.logging.Log

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable exception)
Log a message and exception with debug log level.

Specified by:
debug in interface org.apache.commons.logging.Log

error

public void error(java.lang.Object message)
Log a message with error log level.

Specified by:
error in interface org.apache.commons.logging.Log

error

public void error(java.lang.Object message,
                  java.lang.Throwable exception)
Log a message and exception with error log level.

Specified by:
error in interface org.apache.commons.logging.Log

fatal

public void fatal(java.lang.Object message)
Log a message with fatal log level.

Specified by:
fatal in interface org.apache.commons.logging.Log

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable exception)
Log a message and exception with fatal log level.

Specified by:
fatal in interface org.apache.commons.logging.Log

info

public void info(java.lang.Object message)
Log a message with info log level.

Specified by:
info in interface org.apache.commons.logging.Log

info

public void info(java.lang.Object message,
                 java.lang.Throwable exception)
Log a message and exception with info log level.

Specified by:
info in interface org.apache.commons.logging.Log

trace

public void trace(java.lang.Object message)
Log a message with trace log level.

Specified by:
trace in interface org.apache.commons.logging.Log

trace

public void trace(java.lang.Object message,
                  java.lang.Throwable exception)
Log a message and exception with trace log level.

Specified by:
trace in interface org.apache.commons.logging.Log

warn

public void warn(java.lang.Object message)
Log a message with warn log level.

Specified by:
warn in interface org.apache.commons.logging.Log

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable exception)
Log a message and exception with warn log level.

Specified by:
warn in interface org.apache.commons.logging.Log

isDebugEnabled

public boolean isDebugEnabled()
Is debug logging currently enabled?

Specified by:
isDebugEnabled in interface org.apache.commons.logging.Log

isErrorEnabled

public boolean isErrorEnabled()
Is error logging currently enabled?

Specified by:
isErrorEnabled in interface org.apache.commons.logging.Log

isFatalEnabled

public boolean isFatalEnabled()
Is fatal logging currently enabled?

Specified by:
isFatalEnabled in interface org.apache.commons.logging.Log

isInfoEnabled

public boolean isInfoEnabled()
Is info logging currently enabled?

Specified by:
isInfoEnabled in interface org.apache.commons.logging.Log

isTraceEnabled

public boolean isTraceEnabled()
Is tace logging currently enabled?

Specified by:
isTraceEnabled in interface org.apache.commons.logging.Log

isWarnEnabled

public boolean isWarnEnabled()
Is warning logging currently enabled?

Specified by:
isWarnEnabled in interface org.apache.commons.logging.Log


Test.