Package com.pnfsoftware.jeb.util.base
Class Stacktraces
java.lang.Object
com.pnfsoftware.jeb.util.base.Stacktraces
Utility routines to format stack-traces.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFormat the current call origin chain.static StringformatCallerOriginString(StackTraceElement[] stlist) Format a call origin chain.static StringformatCallerOriginString(StackTraceElement[] stlist, int start) Format a call origin chain starting at a stack trace index.static StringFormat the stack traces of all currently alive threads.static StringformatThreadStacktraces(boolean excludeCurrentThread, boolean includeDeadThreads) Format the stack traces of all threads.static StringgetCallerString(StackTraceElement[] stlist, String... skiplist) Retrieve a compact string identifying the first caller after the skipped stack frames.static StringgetCallerString(String... skiplist) Retrieve a compact string identifying the first caller after the skipped stack frames.
-
Constructor Details
-
Stacktraces
public Stacktraces()
-
-
Method Details
-
getCallerString
Retrieve a compact string identifying the first caller after the skipped stack frames.- Parameters:
skiplist- class name prefixes to skip before selecting a caller- Returns:
- caller string, or null if none was found
-
getCallerString
Retrieve a compact string identifying the first caller after the skipped stack frames.- Parameters:
stlist- optional stack trace elements; if null, the current thread stack is usedskiplist- classes in the stack frame to be skipped before the first "interesting" caller- Returns:
- caller string, or null if none was found
-
formatCallerOriginString
Format the current call origin chain.- Returns:
- formatted caller origin string
-
formatCallerOriginString
Format a call origin chain.- Parameters:
stlist- optional stack trace elements; if null, the current thread stack is used- Returns:
- formatted caller origin string
-
formatCallerOriginString
Format a call origin chain starting at a stack trace index.- Parameters:
stlist- optional stack trace elements; if null, the current thread stack is usedstart- first stack trace element index to format- Returns:
- formatted caller origin string
-
formatThreadStacktraces
Format the stack traces of all currently alive threads.- Returns:
- a record of threads and their current stacktraces
-
formatThreadStacktraces
public static String formatThreadStacktraces(boolean excludeCurrentThread, boolean includeDeadThreads) Format the stack traces of all threads.- Parameters:
excludeCurrentThread- true to omit the current threadincludeDeadThreads- true to include non-alive threads returned by the JVM- Returns:
- a record of threads and their current stacktraces
-