Skip to content

Instantly share code, notes, and snippets.

@nemo-kaz
Created October 10, 2010 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemo-kaz/619034 to your computer and use it in GitHub Desktop.
Save nemo-kaz/619034 to your computer and use it in GitHub Desktop.
// 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