Created
May 22, 2009 04:57
-
-
Save xli/115935 to your computer and use it in GitHub Desktop.
This file contains 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
//find out caller's class name (found from log5j) | |
public static void xxx() { | |
String name = new Exception().getStackTrace()[1].getClassName(); | |
.... | |
} | |
// or | |
String name = Thread.currentThread().getStackTrace()[3].getClassName() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment