org.entityfs.support.log
Class StdOutLogAdapter

java.lang.Object
  extended by org.entityfs.support.log.StdOutLogAdapter
All Implemented Interfaces:
LogAdapter

public final class StdOutLogAdapter
extends Object
implements LogAdapter

This LogAdapter implementation logs all messages to System.out and System.err.

The log adapter levels are mapped to the both output streams like this:

Since:
1.0
Author:
Karl Gustafsson

Constructor Summary
StdOutLogAdapter()
          Create a log adapter that will log messages of the severity INFO or higher.
StdOutLogAdapter(Level l)
          Create a log adapter that will log messages of the supplied severity and higher severities.
StdOutLogAdapter(String level)
           
 
Method Summary
 boolean isDebugEnabled()
          Will messages with the level DEBUG be logged?
 boolean isErrorEnabled()
          Will messages with the level ERROR be logged?
 boolean isFinerEnabled()
          Will messages with the level FINER be logged?
 boolean isInfoEnabled()
          Will messages with the level INFO be logged?
 boolean isSevereEnabled()
          Will messages with the level SEVERE be logged?
 boolean isTraceEnabled()
          Will messages with the level TRACE be logged?
 boolean isWarningEnabled()
          Will messages with the level WARNING be logged?
 void logDebug(Object o)
          Log the result of o.toString() with the level DEBUG.
 void logDebug(Object o, Throwable t)
          Log the result of o.toString() and the exception's stack trace to the level DEBUG.
 void logDebug(Throwable t)
          Log the exception's message and stack trace with the level DEBUG.
 void logError(Object o)
          Log the result of o.toString() with the level ERROR.
 void logError(Object o, Throwable t)
          Log the result of o.toString() and the exception's stack trace to the level ERROR.
 void logError(Throwable t)
          Log the exception's message and stack trace with the level ERROR.
 void logFiner(Object o)
          Log the result of o.toString() with the level FINER.
 void logFiner(Object o, Throwable t)
          Log the result of o.toString() and the exception's stack trace to the level FINER.
 void logFiner(Throwable t)
          Log the exception's message and stack trace with the level FINER.
 void logInfo(Object o)
          Log the result of o.toString() with the level INFO.
 void logInfo(Object o, Throwable t)
          Log the result of o.toString() and the exception's stack trace to the level INFO.
 void logInfo(Throwable t)
          Log the exception's message and stack trace with the level INFO.
 void logSevere(Object o)
          Log the result of o.toString() with the level SEVERE.
 void logSevere(Object o, Throwable t)
          Log the result of o.toString() and the exception's stack trace to the level SEVERE.
 void logSevere(Throwable t)
          Log the exception's message and stack trace with the level SEVERE .
 void logTrace(Object o)
          Log the result of o.toString() with the level TRACE.
 void logTrace(Object o, Throwable t)
          Log the result of o.toString() and the exception's stack trace to the level TRACE.
 void logTrace(Throwable t)
          Log the exception's message and stack trace with the level TRACE.
 void logWarning(Object o)
          Log the result of o.toString() with the level WARNING.
 void logWarning(Object o, Throwable t)
          Log the result of o.toString() and the exception's stack trace to the level WARNING.
 void logWarning(Throwable t)
          Log the exception's message and stack trace with the level WARNING.
 void setLevel(Level l)
          Set the log level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdOutLogAdapter

public StdOutLogAdapter()
Create a log adapter that will log messages of the severity INFO or higher.


StdOutLogAdapter

public StdOutLogAdapter(Level l)
Create a log adapter that will log messages of the supplied severity and higher severities.

Parameters:
l - The lowest severity of messages to log.

StdOutLogAdapter

public StdOutLogAdapter(String level)
Method Detail

isSevereEnabled

public boolean isSevereEnabled()
Description copied from interface: LogAdapter
Will messages with the level SEVERE be logged?

Specified by:
isSevereEnabled in interface LogAdapter
Returns:
true if messages with the level SEVERE will be logged, false otherwise.

isErrorEnabled

public boolean isErrorEnabled()
Description copied from interface: LogAdapter
Will messages with the level ERROR be logged?

Specified by:
isErrorEnabled in interface LogAdapter
Returns:
true if messages with the level ERROR will be logged, false otherwise.

isWarningEnabled

public boolean isWarningEnabled()
Description copied from interface: LogAdapter
Will messages with the level WARNING be logged?

Specified by:
isWarningEnabled in interface LogAdapter
Returns:
true if messages with the level WARNING will be logged, false otherwise.

isInfoEnabled

public boolean isInfoEnabled()
Description copied from interface: LogAdapter
Will messages with the level INFO be logged?

Specified by:
isInfoEnabled in interface LogAdapter
Returns:
true if messages with the level INFO will be logged, false otherwise.

isDebugEnabled

public boolean isDebugEnabled()
Description copied from interface: LogAdapter
Will messages with the level DEBUG be logged?

Specified by:
isDebugEnabled in interface LogAdapter
Returns:
true if messages with the level DEBUG will be logged, false otherwise.

isFinerEnabled

public boolean isFinerEnabled()
Description copied from interface: LogAdapter
Will messages with the level FINER be logged?

Specified by:
isFinerEnabled in interface LogAdapter
Returns:
true if messages with the level FINER will be logged, false otherwise.

isTraceEnabled

public boolean isTraceEnabled()
Description copied from interface: LogAdapter
Will messages with the level TRACE be logged?

Specified by:
isTraceEnabled in interface LogAdapter
Returns:
true if messages with the level TRACE will be logged, false otherwise.

logSevere

public void logSevere(Object o)
Description copied from interface: LogAdapter
Log the result of o.toString() with the level SEVERE.

Specified by:
logSevere in interface LogAdapter
Parameters:
o - The object to log.

logSevere

public void logSevere(Throwable t)
Description copied from interface: LogAdapter
Log the exception's message and stack trace with the level SEVERE .

Specified by:
logSevere in interface LogAdapter
Parameters:
t - The exception to log.

logSevere

public void logSevere(Object o,
                      Throwable t)
Description copied from interface: LogAdapter
Log the result of o.toString() and the exception's stack trace to the level SEVERE.

Specified by:
logSevere in interface LogAdapter
Parameters:
o - The object to log.
t - The exception to log.

logError

public void logError(Object o)
Description copied from interface: LogAdapter
Log the result of o.toString() with the level ERROR.

Specified by:
logError in interface LogAdapter
Parameters:
o - The object to log.

logError

public void logError(Throwable t)
Description copied from interface: LogAdapter
Log the exception's message and stack trace with the level ERROR.

Specified by:
logError in interface LogAdapter
Parameters:
t - The exception to log.

logError

public void logError(Object o,
                     Throwable t)
Description copied from interface: LogAdapter
Log the result of o.toString() and the exception's stack trace to the level ERROR.

Specified by:
logError in interface LogAdapter
Parameters:
o - The object to log.
t - The exception to log.

logWarning

public void logWarning(Object o)
Description copied from interface: LogAdapter
Log the result of o.toString() with the level WARNING.

Specified by:
logWarning in interface LogAdapter
Parameters:
o - The object to log.

logWarning

public void logWarning(Throwable t)
Description copied from interface: LogAdapter
Log the exception's message and stack trace with the level WARNING.

Specified by:
logWarning in interface LogAdapter
Parameters:
t - The exception to log.

logWarning

public void logWarning(Object o,
                       Throwable t)
Description copied from interface: LogAdapter
Log the result of o.toString() and the exception's stack trace to the level WARNING.

Specified by:
logWarning in interface LogAdapter
Parameters:
o - The object to log.
t - The exception to log.

logInfo

public void logInfo(Object o)
Description copied from interface: LogAdapter
Log the result of o.toString() with the level INFO.

Specified by:
logInfo in interface LogAdapter
Parameters:
o - The object to log.

logInfo

public void logInfo(Throwable t)
Description copied from interface: LogAdapter
Log the exception's message and stack trace with the level INFO.

Specified by:
logInfo in interface LogAdapter
Parameters:
t - The exception to log.

logInfo

public void logInfo(Object o,
                    Throwable t)
Description copied from interface: LogAdapter
Log the result of o.toString() and the exception's stack trace to the level INFO.

Specified by:
logInfo in interface LogAdapter
Parameters:
o - The object to log.
t - The exception to log.

logDebug

public void logDebug(Object o)
Description copied from interface: LogAdapter
Log the result of o.toString() with the level DEBUG.

Specified by:
logDebug in interface LogAdapter
Parameters:
o - The object to log.

logDebug

public void logDebug(Throwable t)
Description copied from interface: LogAdapter
Log the exception's message and stack trace with the level DEBUG.

Specified by:
logDebug in interface LogAdapter
Parameters:
t - The exception to log.

logDebug

public void logDebug(Object o,
                     Throwable t)
Description copied from interface: LogAdapter
Log the result of o.toString() and the exception's stack trace to the level DEBUG.

Specified by:
logDebug in interface LogAdapter
Parameters:
o - The object to log.
t - The exception to log.

logFiner

public void logFiner(Object o)
Description copied from interface: LogAdapter
Log the result of o.toString() with the level FINER.

Specified by:
logFiner in interface LogAdapter
Parameters:
o - The object to log.

logFiner

public void logFiner(Throwable t)
Description copied from interface: LogAdapter
Log the exception's message and stack trace with the level FINER.

Specified by:
logFiner in interface LogAdapter
Parameters:
t - The exception to log.

logFiner

public void logFiner(Object o,
                     Throwable t)
Description copied from interface: LogAdapter
Log the result of o.toString() and the exception's stack trace to the level FINER.

Specified by:
logFiner in interface LogAdapter
Parameters:
o - The object to log.
t - The exception to log.

logTrace

public void logTrace(Object o)
Description copied from interface: LogAdapter
Log the result of o.toString() with the level TRACE.

Specified by:
logTrace in interface LogAdapter
Parameters:
o - The object to log.

logTrace

public void logTrace(Throwable t)
Description copied from interface: LogAdapter
Log the exception's message and stack trace with the level TRACE.

Specified by:
logTrace in interface LogAdapter
Parameters:
t - The exception to log.

logTrace

public void logTrace(Object o,
                     Throwable t)
Description copied from interface: LogAdapter
Log the result of o.toString() and the exception's stack trace to the level TRACE.

Specified by:
logTrace in interface LogAdapter
Parameters:
o - The object to log.
t - The exception to log.

setLevel

public void setLevel(Level l)
Description copied from interface: LogAdapter
Set the log level. Use the java.util.logging.Level class to define the level. The Level value is translated to the corresponding logging level in the logging system used by the adapter implementation. See the documentation for that adapter for how the mapping is done.

Specified by:
setLevel in interface LogAdapter
Parameters:
l - The level.