Skip to content

Instantly share code, notes, and snippets.

@greyaperez
Created March 6, 2014 22:03
Show Gist options
  • Save greyaperez/9400708 to your computer and use it in GitHub Desktop.
Save greyaperez/9400708 to your computer and use it in GitHub Desktop.
That returns an array of StackTraceElements that represent the current stack trace of a program.
// Array of StackTraceElements
Thread.currentThread().getStackTrace();
// Return as String, (Uses Apache Commons Lib)
String fullStackTrace = org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(e);
// Get Defined Position of Current Method
(new Throwable()).getStackTrace();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment