com.googlecode.kevinarpe.papaya.logging.slf4j
Class SLF4JLevelLoggerUtils

java.lang.Object
  extended by com.googlecode.kevinarpe.papaya.object.StatelessObject
      extended by com.googlecode.kevinarpe.papaya.logging.slf4j.SLF4JLevelLoggerUtils
All Implemented Interfaces:
ISLF4JLevelLoggerUtils

@FullyTested
public final class SLF4JLevelLoggerUtils
extends StatelessObject
implements ISLF4JLevelLoggerUtils

Methods to create new instances that implement interface SLF4JLevelLogger.

Author:
Kevin Connor ARPE (kevinarpe@gmail.com)
See Also:
StatelessObject, ISLF4JLevelLoggerUtils, INSTANCE

Field Summary
static SLF4JLevelLoggerUtils INSTANCE
          Single instance of this class provided for convenience.
 
Constructor Summary
SLF4JLevelLoggerUtils()
          For projects that require total, static-free mocking capabilities, use this constructor.
 
Method Summary
 SLF4JLevelLogger newInstance(org.slf4j.ILoggerFactory loggerFactory, SLF4JLogLevel logLevel, Class<?> clazz)
          Creates a new logger than logs all messages at a single level.
 SLF4JLevelLogger newInstance(SLF4JLogLevel logLevel, Class<?> clazz)
          This is a convenience method to call ISLF4JLevelLoggerUtils.newInstance(ILoggerFactory, SLF4JLogLevel, Class) with the default global SLF4J ILoggerFactory.
 
Methods inherited from class com.googlecode.kevinarpe.papaya.object.StatelessObject
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final SLF4JLevelLoggerUtils INSTANCE
Single instance of this class provided for convenience. Since this class is stateless, its behaviour is identical between this instance and others.

Constructor Detail

SLF4JLevelLoggerUtils

public SLF4JLevelLoggerUtils()
For projects that require total, static-free mocking capabilities, use this constructor. Else, the static constant INSTANCE will suffice.

Method Detail

newInstance

public SLF4JLevelLogger newInstance(SLF4JLogLevel logLevel,
                                    Class<?> clazz)
This is a convenience method to call ISLF4JLevelLoggerUtils.newInstance(ILoggerFactory, SLF4JLogLevel, Class) with the default global SLF4J ILoggerFactory.

Specified by:
newInstance in interface ISLF4JLevelLoggerUtils

newInstance

public SLF4JLevelLogger newInstance(org.slf4j.ILoggerFactory loggerFactory,
                                    SLF4JLogLevel logLevel,
                                    Class<?> clazz)
Creates a new logger than logs all messages at a single level.

Specified by:
newInstance in interface ISLF4JLevelLoggerUtils
Parameters:
loggerFactory - usually LoggerFactory.getILoggerFactory(), but in rare cases may be different
logLevel - the single level at which the new logging shall log, e.g., SLF4JLogLevel.INFO
clazz - used to set the name of the new logger via Class.getName()
Returns:
new instance that implements inteface SLF4JLevelLogger


Copyright © 2013-2014. All Rights Reserved.