public class StackDumper
extends java.lang.Object
Constructor and Description |
---|
StackDumper() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.StackTraceElement> |
captureStackBelow(java.lang.Class<?>... clazzes)
Captures all of the current stack which is below the given classes.
|
static void |
dump(java.lang.String message)
Dumps the given stack to the system error console.
|
static void |
dump(java.lang.String message,
java.util.List<java.lang.StackTraceElement> stack)
Dumps the given message and stack to the system error console.
|
static void |
dump(java.lang.String message,
java.lang.StackTraceElement[] stackTrace)
Dumps the given message and stack to the system error console.
|
static void |
dump(java.lang.String message,
java.lang.Throwable exception)
Dumps the given message and exception stack to the system error console
|
static void |
dumpWhenSysErrContains(java.lang.String trigger)
Dumps a stack trace anytime trigger string is printed to System.err.
|
static void |
dumpWhenSysOutContains(java.lang.String trigger)
Dumps a stack trace anytime the trigger string is printed to System.out.
|
static java.io.PrintStream |
wrapAndDumpWhenContains(java.io.PrintStream source,
java.lang.String trigger)
Returns a PrintStream which will redirect all of its output to the source PrintStream.
|
public static void dump(java.lang.String message, java.util.List<java.lang.StackTraceElement> stack)
public static void dump(java.lang.String message, java.lang.StackTraceElement[] stackTrace)
public static void dump(java.lang.String message, java.lang.Throwable exception)
public static void dump(java.lang.String message)
public static void dumpWhenSysOutContains(java.lang.String trigger)
public static void dumpWhenSysErrContains(java.lang.String trigger)
public static java.io.PrintStream wrapAndDumpWhenContains(java.io.PrintStream source, java.lang.String trigger)
source
- the returned PrintStream will delegate to this streamtrigger
- the string which triggers a stack dumppublic static java.util.List<java.lang.StackTraceElement> captureStackBelow(java.lang.Class<?>... clazzes)