org.beanfabrics.log
Class Slf4jLogger

java.lang.Object
  extended by org.beanfabrics.log.Slf4jLogger
All Implemented Interfaces:
Logger

public class Slf4jLogger
extends java.lang.Object
implements Logger

The Slf4jLogger us a logging delegator that delegates to Simple Logging Facade for Java.

To use SLF4J please remember to import the required libraries. For more information please see the Logging Example.


Constructor Summary
Slf4jLogger(java.lang.Class clazz)
          Constructs a Log4JLogger for a given Class.
 
Method Summary
 void debug(java.lang.String msg)
          Logs a message at the DEBUG level.
 void error(java.lang.String msg)
          Logs a message at the ERROR level.
 void error(java.lang.String msg, java.lang.Throwable t)
          Logs an Throwable at the ERROR level
 void info(java.lang.String msg)
          Logs a message at the INFO level.
 boolean isDebugEnabled()
          Returns if the DEBUG level is enabled for this instance.
 boolean isErrorEnabled()
          Returns if the ERROR level is enabled for this instance.
 boolean isInfoEnabled()
          Returns if the INFO level is enabled for this instance.
 boolean isTraceEnabled()
          Returns if the TRACE level is enabled for this instance.
 boolean isWarnEnabled()
          Returns if the WARN level is enabled for this instance.
 void trace(java.lang.String msg)
          Logs a message at the TRACE level.
 void warn(java.lang.String msg)
          Logs a message at the WARN level.
 void warn(java.lang.String msg, java.lang.Throwable t)
          Logs an Throwable at the WARN level
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Slf4jLogger

public Slf4jLogger(java.lang.Class clazz)
Constructs a Log4JLogger for a given Class.

Parameters:
clazz - the Class to log for
Method Detail

isTraceEnabled

public boolean isTraceEnabled()
Returns if the TRACE level is enabled for this instance.

Specified by:
isTraceEnabled in interface Logger
Returns:
true if the TRACE level is enabled, else false

trace

public void trace(java.lang.String msg)
Logs a message at the TRACE level.

Specified by:
trace in interface Logger
Parameters:
msg - message to log

isDebugEnabled

public boolean isDebugEnabled()
Returns if the DEBUG level is enabled for this instance.

Specified by:
isDebugEnabled in interface Logger
Returns:
true if the DEBUG level is enabled, else false

debug

public void debug(java.lang.String msg)
Logs a message at the DEBUG level.

Specified by:
debug in interface Logger
Parameters:
msg - message to log

isInfoEnabled

public boolean isInfoEnabled()
Returns if the INFO level is enabled for this instance.

Specified by:
isInfoEnabled in interface Logger
Returns:
true if the INFO level is enabled, else false

info

public void info(java.lang.String msg)
Logs a message at the INFO level.

Specified by:
info in interface Logger
Parameters:
msg - message to log

isWarnEnabled

public boolean isWarnEnabled()
Returns if the WARN level is enabled for this instance.

Specified by:
isWarnEnabled in interface Logger
Returns:
true if the WARN level is enabled, else false

warn

public void warn(java.lang.String msg)
Logs a message at the WARN level.

Specified by:
warn in interface Logger
Parameters:
msg - message to log

warn

public void warn(java.lang.String msg,
                 java.lang.Throwable t)
Logs an Throwable at the WARN level

Specified by:
warn in interface Logger
Parameters:
msg - the message to log
t - the Throwable to log

isErrorEnabled

public boolean isErrorEnabled()
Returns if the ERROR level is enabled for this instance.

Specified by:
isErrorEnabled in interface Logger
Returns:
true if the ERROR level is enabled, else false

error

public void error(java.lang.String msg)
Logs a message at the ERROR level.

Specified by:
error in interface Logger
Parameters:
msg - message to log

error

public void error(java.lang.String msg,
                  java.lang.Throwable t)
Logs an Throwable at the ERROR level

Specified by:
error in interface Logger
Parameters:
msg - the message to log
t - the Throwable to log