|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gillius.Util.CircularLog
public class CircularLog
CircularLog is useful to provide the last 'n' log messages in a crash event, when extremely verbose logging is desired, and outputting to stdout/err would cause problems due to the amount of output.
The intention of this class is that writeLog calls would be injected temporarily into code, and then the debugger is used to view the actual log.
Field Summary | |
---|---|
static int |
LOG_SIZE
|
Constructor Summary | |
---|---|
CircularLog()
|
Method Summary | |
---|---|
static java.util.List<java.lang.String> |
getFilteredMessages(java.lang.String filter)
Returns getLastMessages() but filtered such that only log entries containing the
filter string appear are in the returned list. |
static java.util.List<java.lang.String> |
getLastMessages()
Returns a copy of the last LOG_SIZE messages as a list. |
static void |
writeLog(java.lang.String s)
Writes a message to the log. |
static void |
writeLog(java.lang.String format,
java.lang.Object... args)
Writes a message to the log using the String.format(String, Object[]) method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOG_SIZE
Constructor Detail |
---|
public CircularLog()
Method Detail |
---|
public static void writeLog(java.lang.String s)
s
- non-null Stringpublic static void writeLog(java.lang.String format, java.lang.Object... args)
String.format(String, Object[])
method.
public static java.util.List<java.lang.String> getLastMessages()
LOG_SIZE
messages as a list.
public static java.util.List<java.lang.String> getFilteredMessages(java.lang.String filter)
getLastMessages()
but filtered such that only log entries containing the
filter string appear are in the returned list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |