org.javasimon.callback.logging
Class LogTemplate<C>

java.lang.Object
  extended by org.javasimon.callback.logging.LogTemplate<C>
Direct Known Subclasses:
DelegateLogTemplate, DisabledLogTemplate, JULLogTemplate, SLF4JLogTemplate

public abstract class LogTemplate<C>
extends Object

Log template interface is the root of a hierarchy of implementations with different purposes.

Author:
gquintana

Constructor Summary
LogTemplate()
           
 
Method Summary
protected abstract  boolean isEnabled(C context)
          Tell whether logging is enabled.
 boolean log(C context, LogMessageSource<C> messageSource)
          If enabled, get message for context and log id.
protected abstract  void log(String message)
          Log a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogTemplate

public LogTemplate()
Method Detail

isEnabled

protected abstract boolean isEnabled(C context)
Tell whether logging is enabled.

Returns:
Logging enabled

log

public final boolean log(C context,
                         LogMessageSource<C> messageSource)
If enabled, get message for context and log id.

Parameters:
context - Context
messageSource - Message producer

log

protected abstract void log(String message)
Log a message.



Copyright © 2013. All Rights Reserved.