|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.Debug
public final class Debug
provides globally accessible methods and variables for convenient debugging
Monitor| Nested Class Summary | |
|---|---|
static class |
Debug.FileExceptionHandler
can be used to conveniently write all exceptions to a file. |
| Field Summary | |
|---|---|
static Thread.UncaughtExceptionHandler |
dialogExceptionHandler
can be used to display a dialog for uncaught exceptions. |
static boolean |
enabled
false by default |
static MyFile |
file
a MyFile object that is initially null |
static Logger |
logger
the logger is initialized as a plain empty logger |
static Monitor |
monitor
monitor is initialized with new Monitor() |
static Stopwatch |
stopwatch
initialized as non-running |
| Method Summary | |
|---|---|
static void |
addSystemErrFile(File file,
boolean append)
|
static void |
addSystemOutFile(File file,
boolean append)
|
static TimerTask |
createMemoryLogTimer()
|
static void |
dumpSettings()
prints all settings (including all system properties and environment variables) to the console. |
static void |
dumpStack()
|
static String |
getStackTraceAsString()
excludes the call to this method and beyond in the stack trace |
static boolean |
printToFile(Throwable t,
File file,
boolean append)
returns true only if operation was successfull |
static File |
printToTempFile(Throwable t)
returns the name of the temp file the Throwable was written to or null if the write attempt was unsuccessful. |
static void |
say(Object txt)
just for test debugging; prints the text along w/ the word debug on the console (to distinguish from standard System.out.println() in the source code) |
static void |
setSystemErr(File file,
boolean append)
|
static void |
setSystemOut(File file,
boolean append)
|
static void |
show(Component parent,
Object message)
displays a debug message in a modal dialog |
static void |
show(Object message)
displays a debug message in a modal dialog |
static void |
showMemoryGauge()
pops up a JMemoryGauge in a simple JMainFrame |
static String |
stackTraceAsString(Throwable t)
|
static String |
stackTraceAsString(Throwable tw,
Thread td)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Thread.UncaughtExceptionHandler dialogExceptionHandler
Thread.setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler),
Thread.setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler)public static final Monitor monitor
public static volatile boolean enabled
public static final Logger logger
public static final Stopwatch stopwatch
public static MyFile file
| Method Detail |
|---|
public static TimerTask createMemoryLogTimer()
public static void showMemoryGauge()
JMemoryGaugepublic static void show(Object message)
public static void show(Component parent,
Object message)
public static String stackTraceAsString(Throwable t)
public static String stackTraceAsString(Throwable tw,
Thread td)
public static File printToTempFile(Throwable t)
public static boolean printToFile(Throwable t,
File file,
boolean append)
public static void dumpSettings()
public static String getStackTraceAsString()
public static void dumpStack()
public static void addSystemErrFile(File file,
boolean append)
throws FileNotFoundException
FileNotFoundException
public static void addSystemOutFile(File file,
boolean append)
throws FileNotFoundException
FileNotFoundException
public static void setSystemErr(File file,
boolean append)
throws FileNotFoundException
FileNotFoundException
public static void setSystemOut(File file,
boolean append)
throws FileNotFoundException
FileNotFoundExceptionpublic static void say(Object txt)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||