|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.townleyenterprises.trace.TraceCore
com.townleyenterprises.trace.MethodTrace
com.townleyenterprises.trace.ErrorTrace
This class implements generic trace facilities. The general usage should be for classes who will support tracing to implement the Traceable interface and then create a static attribute which will be used for trace messages of that class.
The maturity level of the class to be traced may be specified, allowing author-defined filtering of trace messages for classes that have been more exhaustively tested. The maturity level specifies the trace threshold at which messages of this class should be displayed.
Since version 3.0, instances of this class are now independently controlable for the trace level. This means that certain classes can be always disabled, even if they are fully instrumented.
This class is now thread safe.
| Field Summary |
| Fields inherited from class com.townleyenterprises.trace.MethodTrace |
TRACE_ARG_GEN_FMT, TRACE_ARG_STR_FMT, TRACE_RETURN_FMT, TRACE_RETURN_GEN_FMT, TRACE_RETURN_STR_FMT, TRACE_START_FMT, TRACE_THROW_FMT |
| Constructor Summary | |
ErrorTrace()
This is the empty constructor for an ErrorTrace instance. |
|
ErrorTrace(java.lang.String className)
Helper method for the default maturity level |
|
ErrorTrace(java.lang.String className,
int maturity)
This is the normal constructor for the ErrorTrace class that allows specification of the class name to be traced and also allows setting the maturity level. |
|
| Method Summary | |
void |
methodReturn()
This method should be called to specify that the method is about to return, with no value. |
boolean |
methodReturn(boolean arg)
|
double |
methodReturn(double arg)
|
long |
methodReturn(long arg)
|
java.lang.Object |
methodReturn(java.lang.Object arg)
|
java.lang.String |
methodReturn(java.lang.String arg)
This method should be called to specify that the method is about to return, with the indicated value. |
Traceable |
methodReturn(Traceable arg)
|
java.lang.Throwable |
methodThrow(java.lang.Throwable ex,
boolean print)
This method is used to specify that the method is about to throw an exception. |
| Methods inherited from class com.townleyenterprises.trace.MethodTrace |
methodArg, methodArg, methodArg, methodArg, methodArg, methodArg, methodArgs, methodReturn, methodReturn, methodStart, methodStart, methodStart, methodThrow, popCurrentMethod |
| Methods inherited from class com.townleyenterprises.trace.TraceCore |
getInstanceTraceLevel, getShowThreadNameAlways, getShowTimestamp, getTimestampFormat, getTraceFile, getTraceLevel, getTraceLevel, getTraceStream, loadInstanceSettings, loadSettings, printStackTrace, setInstanceTraceLevel, setShowThreadNameAlways, setShowTimestamp, setTimestampFormat, setTraceFile, setTraceLevel, setTraceLevel, tprintln, tprintln, willTrace |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ErrorTrace()
public ErrorTrace(java.lang.String className)
className - the name to appear in the logs
public ErrorTrace(java.lang.String className,
int maturity)
className - the name to appear in the trace logsmaturity - the maturity level of the class| Method Detail |
public void methodReturn()
MethodTrace
methodReturn in class MethodTracepublic java.lang.String methodReturn(java.lang.String arg)
MethodTrace
methodReturn in class MethodTracepublic boolean methodReturn(boolean arg)
methodReturn in class MethodTracepublic double methodReturn(double arg)
methodReturn in class MethodTracepublic long methodReturn(long arg)
methodReturn in class MethodTracepublic Traceable methodReturn(Traceable arg)
methodReturn in class MethodTracepublic java.lang.Object methodReturn(java.lang.Object arg)
methodReturn in class MethodTrace
public java.lang.Throwable methodThrow(java.lang.Throwable ex,
boolean print)
MethodTrace
methodThrow in class MethodTraceex - the exception that is to be thrownprint - if true, print the stack trace of the
exception automatically.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||