logahawk
Class BufferedLogger
java.lang.Object
logahawk.BufferedLogger
- All Implemented Interfaces:
- Logger
@ThreadSafe
public class BufferedLogger
- extends Object
- implements Logger
A Logger implementation that buffers all log arguments (prior to any formatting). This class does not flush
its entries
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entries
protected final Queue<List<Object>> entries
- The Queue used to hold log arguments. The Queue should be thread-safe, as this class does no additional
synchronizing beyond what the Queue provides. The default constructor initializes this to a
ConcurrentLinkedQueue which ensures thread-safety.
Each entry the log arguments from a single call to one of the various log messages, which is converted to a List using Arrays.asList(Object[])
BufferedLogger
public BufferedLogger()
- Initializes the
entries field with a ConcurrentLinkedQueue, which ensure the
thread-safety of this class.
BufferedLogger
public BufferedLogger(Queue<List<Object>> queue)
- Parameters:
queue - The Queue instance to be used for the entries field. Note that this Queue must
be thread-safe for this class to be thread-safe.
alert
public void alert(Object... data)
- Specified by:
alert in interface Logger
debug
public void debug(Object... data)
- Specified by:
debug in interface Logger
error
public void error(Object... data)
- Specified by:
error in interface Logger
fatal
public void fatal(Object... data)
- Specified by:
fatal in interface Logger
info
public void info(Object... data)
- Specified by:
info in interface Logger
log
public void log(Severity severity,
Object... data)
- Specified by:
log in interface Logger
panic
public void panic(Object... data)
- Specified by:
panic in interface Logger
warn
public void warn(Object... data)
- Specified by:
warn in interface Logger
getEntries
public Queue<List<Object>> getEntries()