|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jminor.common.model.MethodLogger
public class MethodLogger
A cyclycal method logger.
Constructor Summary | |
---|---|
MethodLogger(int logSize)
Instantiates a new MethodLogger. |
|
MethodLogger(int logSize,
boolean enabled)
Instantiates a new MethodLogger. |
Method Summary | |
---|---|
protected String |
argumentArrayToString(Object[] arguments)
|
long |
getLastAccessDate()
|
String |
getLastAccessedMethod()
|
String |
getLastAccessMessage()
|
long |
getLastExitDate()
|
String |
getLastExitedMethod()
|
List<LogEntry> |
getLogEntries()
|
protected String |
getMethodArgumentAsString(Object argument)
|
boolean |
isEnabled()
|
void |
logAccess(String method,
Object[] arguments)
|
LogEntry |
logExit(String method,
Throwable exception,
List<LogEntry> subLog)
|
LogEntry |
logExit(String method,
Throwable exception,
List<LogEntry> subLog,
String exitMessage)
|
void |
reset()
Resets this log |
void |
setEnabled(boolean enabled)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MethodLogger(int logSize)
logSize
- the log sizepublic MethodLogger(int logSize, boolean enabled)
logSize
- the log sizeenabled
- true if this logger should be enabledMethod Detail |
---|
public final long getLastAccessDate()
public final String getLastAccessedMethod()
public final String getLastAccessMessage()
public final long getLastExitDate()
public final String getLastExitedMethod()
public final void reset()
public final List<LogEntry> getLogEntries()
public final void logAccess(String method, Object[] arguments)
method
- the method being accessedarguments
- the method argumentspublic final LogEntry logExit(String method, Throwable exception, List<LogEntry> subLog)
method
- the method being exitedexception
- the exception, if anysubLog
- the sub-log, if any
public final LogEntry logExit(String method, Throwable exception, List<LogEntry> subLog, String exitMessage)
method
- the method being exitedexception
- the exception, if anysubLog
- the sub-log, if anyexitMessage
- the exit message
public final boolean isEnabled()
public final void setEnabled(boolean enabled)
enabled
- true to enable this loggerprotected String getMethodArgumentAsString(Object argument)
argument
- the argument
protected final String argumentArrayToString(Object[] arguments)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |