org.logicalcobwebs.logging.impl
Class Jdk14Logger

java.lang.Object
  extended by org.logicalcobwebs.logging.impl.Jdk14Logger
All Implemented Interfaces:
Log

public final class Jdk14Logger
extends java.lang.Object
implements Log

Implementation of the org.logicalcobwebs.logging.Log interfaces that wraps the standard JDK logging mechanisms that were introduced in the Merlin release (JDK 1.4).

Version:
$Revision: 1.7 $ $Date: 2003/09/11 23:00:23 $
Author:
Scott Sanders, Berin Loritsch, Peter Donald

Field Summary
private  java.lang.reflect.Method getClassNameMethod
           
private  java.lang.reflect.Method getMethodNameMethod
           
private  java.lang.reflect.Method getStackTraceMethod
           
private  java.lang.reflect.Method isLoggableMethod
           
private  java.lang.Object levelFINE
           
private  java.lang.Object levelFINEST
           
private  java.lang.Object levelINFO
           
private  java.lang.Object levelSEVERE
           
private  java.lang.Object levelWARNING
           
private  java.lang.Object logger
          The underlying Logger implementation we are using.
private  java.lang.reflect.Method logpExMethod
           
private  java.lang.reflect.Method logpMethod
           
 
Constructor Summary
Jdk14Logger(java.lang.String name)
          Construct a named instance of this Logger.
 
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?
private  boolean isLoggable(java.lang.Object level)
           
 boolean isTraceEnabled()
          Is tace logging currently enabled?
 boolean isWarnEnabled()
          Is warning logging currently enabled?
private  void log(java.lang.Object level, java.lang.String msg, java.lang.Throwable ex)
           
 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
 

Field Detail

logger

private java.lang.Object logger
The underlying Logger implementation we are using.


logpMethod

private java.lang.reflect.Method logpMethod

logpExMethod

private java.lang.reflect.Method logpExMethod

isLoggableMethod

private java.lang.reflect.Method isLoggableMethod

getStackTraceMethod

private java.lang.reflect.Method getStackTraceMethod

getClassNameMethod

private java.lang.reflect.Method getClassNameMethod

getMethodNameMethod

private java.lang.reflect.Method getMethodNameMethod

levelFINEST

private java.lang.Object levelFINEST

levelFINE

private java.lang.Object levelFINE

levelINFO

private java.lang.Object levelINFO

levelWARNING

private java.lang.Object levelWARNING

levelSEVERE

private java.lang.Object levelSEVERE
Constructor Detail

Jdk14Logger

public Jdk14Logger(java.lang.String name)
Construct a named instance of this Logger.

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

log

private void log(java.lang.Object level,
                 java.lang.String msg,
                 java.lang.Throwable ex)

debug

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

Specified by:
debug in interface Log
Parameters:
message - log this message

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 Log
Parameters:
message - log this message
exception - log this cause

error

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

Specified by:
error in interface Log
Parameters:
message - log this message

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 Log
Parameters:
message - log this message
exception - log this cause

fatal

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

Specified by:
fatal in interface Log
Parameters:
message - log this message

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 Log
Parameters:
message - log this message
exception - log this cause

info

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

Specified by:
info in interface Log
Parameters:
message - log this message

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 Log
Parameters:
message - log this message
exception - log this cause

isDebugEnabled

public boolean isDebugEnabled()
Is debug logging currently enabled?

Specified by:
isDebugEnabled in interface Log

isErrorEnabled

public boolean isErrorEnabled()
Is error logging currently enabled?

Specified by:
isErrorEnabled in interface Log

isFatalEnabled

public boolean isFatalEnabled()
Is fatal logging currently enabled?

Specified by:
isFatalEnabled in interface Log

isInfoEnabled

public boolean isInfoEnabled()
Is info logging currently enabled?

Specified by:
isInfoEnabled in interface Log

isTraceEnabled

public boolean isTraceEnabled()
Is tace logging currently enabled?

Specified by:
isTraceEnabled in interface Log

isWarnEnabled

public boolean isWarnEnabled()
Is warning logging currently enabled?

Specified by:
isWarnEnabled in interface Log

trace

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

Specified by:
trace in interface Log
Parameters:
message - log this message

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 Log
Parameters:
message - log this message
exception - log this cause

warn

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

Specified by:
warn in interface Log
Parameters:
message - log this message

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 Log
Parameters:
message - log this message
exception - log this cause

isLoggable

private boolean isLoggable(java.lang.Object level)