logahawk
Class SimpleLogger
java.lang.Object
logahawk.AbstractLogger
logahawk.SimpleLogger
- All Implemented Interfaces:
- Logger
@ThreadSafe
public class SimpleLogger
- extends AbstractLogger
A simple implementation of Logger. This Logger blocks the caller when logging until the log request is completely
handled. (This class does not use LogEntry
.)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logMetaProvider
protected final LogMetaProvider logMetaProvider
argumentFormatterContainer
protected final ArgumentFormatterContainer argumentFormatterContainer
listenerContainer
protected final ListenerContainer listenerContainer
signatureFormatterContainer
protected final SignatureFormatterContainer signatureFormatterContainer
SimpleLogger
public SimpleLogger()
SimpleLogger
public SimpleLogger(LogMetaProvider logMetaProvider)
SimpleLogger
public SimpleLogger(ArgumentFormatterContainer argumentFormatterContainer,
SignatureFormatterContainer signatureFormatterContainer,
ListenerContainer listenerContainer)
SimpleLogger
public SimpleLogger(LogMetaProvider logMetaProvider,
ArgumentFormatterContainer argumentFormatterContainer,
SignatureFormatterContainer signatureFormatterContainer,
ListenerContainer listenerContainer)
log
public void log(Severity severity,
Object... data)
- Description copied from interface:
Logger
- Logs message with a provide
Severity
. Useful for dynamically determined Severity
messages.
- Specified by:
log
in interface Logger
- Specified by:
log
in class AbstractLogger
getLogMetaProvider
public LogMetaProvider getLogMetaProvider()
getArgumentFormatterContainer
public ArgumentFormatterContainer getArgumentFormatterContainer()
getListenerContainer
public ListenerContainer getListenerContainer()
getSignatureFormatterContainer
public SignatureFormatterContainer getSignatureFormatterContainer()
broadcast
protected void broadcast(Severity severity,
Object... data)
- This will broadcast the log message to all the Listener instances registered with this object. The epoch for the
log messages will be set to the start of this method, and will be used for all calls to Listener.log().
format
protected String format(Object... data)
- This will use the installed "SignatureFormatter" and "ArgumentFormatter" objects to format the provided arguments
into a log-able string. This will call the static "format" method with the required data.
format
protected String format(List<Object> arguments)
- This will use the provided SignatureFormatters and ArgumentFormatters objects to format the provided arguments into
a log-able string. This will return null if there are no arguments provided. This will not catch any Exceptions
encountered.
If any of the formatters thrown an exception, this will fall back on a default formatting that is minimal but still
useful.