Created
October 10, 2010 06:47
-
-
Save nemo-kaz/619034 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
// g100pon #67 実行中のクラス/メソッド名を取得 | |
def getMyInfo() { | |
def the_thisClassName = getClass().getName() | |
def the_inThisObject = new Throwable().getStackTrace().findAll { | |
the_stackTraceElement -> | |
the_thisClassName.equals(the_stackTraceElement.getClassName()) | |
} | |
println "className = "+ the_inThisObject[0].getProperties().className | |
println "methodName = "+ the_inThisObject[0].getProperties().methodName | |
} | |
getMyInfo() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment