net.sourceforge.chaperon.common
Class ConsoleLog

java.lang.Object
  extended by net.sourceforge.chaperon.common.ConsoleLog
All Implemented Interfaces:
org.apache.commons.logging.Log

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

Logger sending everything to the standard output streams. This is mainly for the cases when you have a utility that does not have a logger to supply.

Version:
CVS $Id: ConsoleLog.java,v 1.4 2003/12/14 09:53:56 benedikta Exp $
Author:
Stephan Michels

Field Summary
static int DEBUG
           
static int ERROR
           
static int FATAL
           
static int INFO
           
static int TRACE
           
static int WARN
           
 
Constructor Summary
ConsoleLog()
           
ConsoleLog(int level)
           
 
Method Summary
 void debug(java.lang.Object message)
           Log a message with debug log level.
 void debug(java.lang.Object message, java.lang.Throwable t)
           Log an error 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 t)
           Log an error 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 t)
           Log an error 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 t)
           Log an error 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 trace logging currently enabled?
 boolean isWarnEnabled()
           Is warning logging currently enabled?
 void trace(java.lang.Object message)
           Log a message with trace log level.
 void trace(java.lang.Object message, java.lang.Throwable t)
           Log an error 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 t)
           Log an error with warn log level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static final int TRACE
See Also:
Constant Field Values

DEBUG

public static final int DEBUG
See Also:
Constant Field Values

INFO

public static final int INFO
See Also:
Constant Field Values

WARN

public static final int WARN
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

FATAL

public static final int FATAL
See Also:
Constant Field Values
Constructor Detail

ConsoleLog

public ConsoleLog()

ConsoleLog

public ConsoleLog(int level)
Method Detail

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

trace

public void trace(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with trace log level.

Specified by:
trace in interface org.apache.commons.logging.Log
Parameters:
message - log this message
t - log this cause

isTraceEnabled

public boolean isTraceEnabled()

Is trace logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatination) when the log level is more than trace.

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

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

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with debug log level.

Specified by:
debug in interface org.apache.commons.logging.Log
Parameters:
message - log this message
t - log this cause

isDebugEnabled

public boolean isDebugEnabled()

Is debug logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatination) when the log level is more than debug.

Specified by:
isDebugEnabled 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
Parameters:
message - log this message

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)

Log an error with info log level.

Specified by:
info in interface org.apache.commons.logging.Log
Parameters:
message - log this message
t - log this cause

isInfoEnabled

public boolean isInfoEnabled()

Is info logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatination) when the log level is more than info.

Specified by:
isInfoEnabled 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
Parameters:
message - log this message

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)

Log an error with warn log level.

Specified by:
warn in interface org.apache.commons.logging.Log
Parameters:
message - log this message
t - log this cause

isWarnEnabled

public boolean isWarnEnabled()

Is warning logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatination) when the log level is more than warning.

Specified by:
isWarnEnabled 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
Parameters:
message - log this message

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with error log level.

Specified by:
error in interface org.apache.commons.logging.Log
Parameters:
message - log this message
t - log this cause

isErrorEnabled

public boolean isErrorEnabled()

Is error logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatination) when the log level is more than error.

Specified by:
isErrorEnabled 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
Parameters:
message - log this message

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with fatal log level.

Specified by:
fatal in interface org.apache.commons.logging.Log
Parameters:
message - log this message
t - log this cause

isFatalEnabled

public boolean isFatalEnabled()

Is fatal logging currently enabled?

Call this method to prevent having to perform expensive operations (for example, String concatination) when the log level is more than fatal.

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


Copyright ? 2003 Chaperon project. All Rights Reserved.