Created
November 29, 2013 04:02
-
-
Save wliment/7701413 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace() According to the Javadocs: The last element of the array represents the bottom of the stack, which is the least recent method invocation in the sequence. A StackTraceElement has getClassName(), getFileName(), getLineNumber() and getMethodName(). You will have to experiment to determine which index you want (probably stackTraceElements[1] or [2]). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment