|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.util.DebugWriter
This class provides standard methods for reporting various categories
of information to aid in debugging.
No static methods should be added to this class, since that makes it
much more difficult to promote it to an interface, if this becomes desireable
in the future.
Supported API: true
Extendable: false
Field Summary | |
private boolean |
addThreadNames
|
private static String |
CLASSNAME
|
private SimpleDateFormat |
dateFormat
|
private OutputFile |
log
|
private static PrintStream |
OUT
|
private static long |
previousTimeSec
|
private static String |
RESOURCE
|
private boolean |
tee
|
private static String |
timeStamp
|
private boolean |
verbose
|
Constructor Summary | |
DebugWriter()
|
Method Summary | |
void |
dump(Object object)
Reports a dump of the state of an object. |
void |
enter(String classname,
String method)
Reports the entry into a method. |
void |
enter(String classname,
String method,
Object[] args)
Reports the entry into a method. |
void |
exception(Throwable exception)
Reports the String representation of the exception. |
void |
exception(Throwable exception,
boolean stack_trace)
Reports the String representation of the exception and prints its stack trace. |
void |
exit(String classname,
String method)
Reports the exit from a method. |
void |
exit(String classname,
String method,
boolean return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
byte return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
char return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
double return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
float return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
int return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
long return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
Object return_arg)
Reports the exit from a method. |
void |
exit(String classname,
String method,
short return_arg)
Reports the exit from a method. |
protected void |
finalize()
|
void |
identify(Object object)
Reports the identity of an object. |
private String |
iteratedFilename(String name,
int iterations)
|
void |
printStackTrace(String message)
Reports a stack trace, after printing passed message. |
private void |
printStackTrace(Throwable stackAccess)
|
void |
report(String message)
Reports the passed message. |
void |
setLogFile(String name,
boolean append,
boolean tee,
int iterations,
String date_format,
boolean add_thread)
Deprecated. |
void |
setLogFile(String name,
boolean append,
boolean tee,
int iterations,
String date_format,
boolean add_thread,
boolean verbose)
Sets the log file output parameters. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static final PrintStream OUT
private boolean tee
private boolean addThreadNames
private SimpleDateFormat dateFormat
private static String timeStamp
private static long previousTimeSec
private OutputFile log
private boolean verbose
Constructor Detail |
public DebugWriter()
Method Detail |
public void report(String message)
message
- the text to reportpublic void enter(String classname, String method)
classname
- is the name of the calling classmethod
- is the name of the calling methodpublic void enter(String classname, String method, Object[] args)
classname
- is the name of the calling classmethod
- is the name of the calling methodargs
- is the array of the values that are being passed into
the calling methodpublic void exit(String classname, String method)
classname
- is the name of the calling classmethod
- is the name of the calling methodpublic void exit(String classname, String method, Object return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, boolean return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, byte return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, char return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, short return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, int return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, long return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, float return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void exit(String classname, String method, double return_arg)
classname
- is the name of the calling classmethod
- is the name of the calling methodreturn_arg
- is the value being returned by the calling methodpublic void dump(Object object)
object
- the object to identifypublic void identify(Object object)
object
- the object to identifypublic void exception(Throwable exception)
exception
- the exception/throwable to report.public void exception(Throwable exception, boolean stack_trace)
exception
- the exception/throwable to report.stack_trace
- if true, will print the stack trace from the
exception.public void printStackTrace(String message)
message
- a message to print prior to the stack trace.public void setLogFile(String name, boolean append, boolean tee, int iterations, String date_format, boolean add_thread)
name
- the name of the log file, including full directory
specification.append
- if true, opens the log file in append mode.tee
- if true, will also send all output to standard outputiterations
- if a value greater than zero is passed, will
iterate file name up to the number specified. (e.g. file1, file2,
file3...)date_format
- if a date format is passed, it will be used
in prefixing each line with a time stamp; if nothing is provided,
the lines will not be prefixed with a time stamp.add_thread
- if true, each output line will include the name
of the thread being executed.public void setLogFile(String name, boolean append, boolean tee, int iterations, String date_format, boolean add_thread, boolean verbose)
name
- the name of the log file, including full directory
specification.append
- if true, opens the log file in append mode.tee
- if true, will also send all output to standard outputiterations
- if a value greater than zero is passed, will
iterate file name up to the number specified. (e.g. file1, file2,
file3...)date_format
- if a date format is passed, it will be used
in prefixing each line with a time stamp; if nothing is provided,
the lines will not be prefixed with a time stamp.add_thread
- if true, each output line will include the name
of the thread being executed.verbose
- if true, will use the most verbose option for info
reporting, but may only apply to certain method.protected void finalize()
private String iteratedFilename(String name, int iterations)
private void printStackTrace(Throwable stackAccess)
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |