Package com.metsci.glimpse.util
Class StackTraceUtils
- java.lang.Object
-
- com.metsci.glimpse.util.StackTraceUtils
-
public class StackTraceUtils extends Object
Utilities for examining stack traces at any point during program execution.- Author:
- moskowitz
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetCaller()Name of caller for debug/trace/logging purposes.static StringgetCallers(int nBack)Names of callers for debug/trace/logging purposes.static StringgetCallersCompact(int nBack)Names of callers for debug/trace/logging purposes.static StringstackTraceToString(Exception e, int nBack)static StringstackTraceToString(StackTraceElement[] trace, int nBack)
-
-
-
Method Detail
-
getCaller
public static String getCaller()
Name of caller for debug/trace/logging purposes.- Returns:
- Information String about caller suitable for logging.
-
getCallers
public static String getCallers(int nBack)
Names of callers for debug/trace/logging purposes.- Parameters:
nBack- how far up the stack to go (should be >=1)- Returns:
- Information String about callers (up the stack) suitable for logging.
-
getCallersCompact
public static String getCallersCompact(int nBack)
Names of callers for debug/trace/logging purposes.- Parameters:
nBack- how far up the stack to go (should be >=1)- Returns:
- Information String about callers (up the stack) suitable for logging.
-
stackTraceToString
public static String stackTraceToString(StackTraceElement[] trace, int nBack)
-
-