public class CircularMemoryLogAdapter extends java.lang.Object implements LogAdapterInterface
LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_OFF, LOG_TRACE, LOG_WARN, logLevelSet| Constructor and Description |
|---|
CircularMemoryLogAdapter(int maxMemoryLinesCapacity)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearLog()
Clear the in-memory log.
|
java.util.ArrayList<java.lang.String> |
getLog()
Get the in-memory log.
|
int |
getLogLevel()
Get the log level.
|
int |
getMaxMemoryLinesCapacity()
Get the maximum capacity of the stored 'in memory lines'.
|
void |
init(java.lang.String[] args)
Initialize the log adapter.
|
void |
message(int logLevel,
java.util.ArrayList<java.lang.String> messageList)
Log a list of messages.
|
void |
message(int logLevel,
java.lang.String message)
Log a message.
|
void |
message(int logLevel,
java.lang.String context,
java.util.ArrayList<java.lang.String> messageList)
Log a list of messages.
|
void |
message(int logLevel,
java.lang.String context,
java.lang.String message)
Log a message.
|
void |
message(int logLevel,
java.lang.String context,
java.lang.String message,
java.lang.Throwable throwable)
Log a message with a stack trace.
|
void |
message(int logLevel,
java.lang.String message,
java.lang.Throwable throwable)
Log a message with a stack trace.
|
void |
messageStacktrace(int logLevel,
java.lang.String message)
Log a message, and log the stacktrace of the current thread.
|
void |
messageStacktrace(int logLevel,
java.lang.String message,
java.lang.Throwable throwable)
Log a message with a stack trace, and log the stacktrace of the current thread.
|
void |
setLogLevel(int logLevel)
Set the log level.
|
void |
writeMessage(int logLevel,
java.lang.String context,
java.lang.String message)
Basic method to write a log message.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlogLevelToString, stringToLogLevel, verifyLogLevelpublic CircularMemoryLogAdapter(int maxMemoryLinesCapacity)
maxMemoryLinesCapacity - the maximum capacity of the stored 'in memory lines'public int getMaxMemoryLinesCapacity()
public void init(java.lang.String[] args)
init in interface LogAdapterInterfaceargs - this log adapter does not support any initializing arguments, pass null or an empty array.public void setLogLevel(int logLevel)
setLogLevel in interface LogAdapterInterfacelogLevel - the log level to setLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic int getLogLevel()
getLogLevel in interface LogAdapterInterfaceLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void message(int logLevel,
java.lang.String message)
message in interface LogAdapterInterfacelogLevel - the log level of the messagemessage - the messageLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void message(int logLevel,
java.util.ArrayList<java.lang.String> messageList)
message in interface LogAdapterInterfacelogLevel - the log level of the messagesmessageList - the list of messagesLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void message(int logLevel,
java.lang.String context,
java.lang.String message)
message in interface LogAdapterInterfacelogLevel - the log level of the messagecontext - the context of the message, which is normally the current thread namemessage - the messageLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void message(int logLevel,
java.lang.String context,
java.util.ArrayList<java.lang.String> messageList)
message in interface LogAdapterInterfacelogLevel - the log level of the messagescontext - the context of the message, which is normally the current thread namemessageList - the list of messagesLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void message(int logLevel,
java.lang.String message,
java.lang.Throwable throwable)
message in interface LogAdapterInterfacelogLevel - the log level of the messagemessage - the messagethrowable - the throwable used to generate the stack trace informationLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void message(int logLevel,
java.lang.String context,
java.lang.String message,
java.lang.Throwable throwable)
message in interface LogAdapterInterfacelogLevel - the log level of the messagecontext - the context of the message, which is normally the current thread namemessage - the messagethrowable - the throwable used to generate the stack trace informationLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void messageStacktrace(int logLevel,
java.lang.String message)
messageStacktrace in interface LogAdapterInterfacelogLevel - logLevel the log level of the messagemessage - the messageLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void messageStacktrace(int logLevel,
java.lang.String message,
java.lang.Throwable throwable)
messageStacktrace in interface LogAdapterInterfacelogLevel - logLevel the log level of the messagemessage - the messagethrowable - the throwable used to generate the stack trace informationLogAdapterInterface.LOG_DEBUG,
LogAdapterInterface.LOG_TRACE,
LogAdapterInterface.LOG_INFO,
LogAdapterInterface.LOG_WARN,
LogAdapterInterface.LOG_ERROR,
LogAdapterInterface.LOG_FATAL,
LogAdapterInterface.LOG_OFFpublic void writeMessage(int logLevel,
java.lang.String context,
java.lang.String message)
logLevel - the log level of the messagecontext - the context of the message, which is normally the current thread namemessage - the messagepublic java.util.ArrayList<java.lang.String> getLog()
public void clearLog()
clearLog in interface LogAdapterInterface