Guest User

Untitled

a guest
Jun 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. // g100pon #67 実行中のクラス/メソッド名を取得
  2.  
  3. def getMyInfo() {
  4. def the_thisClassName = getClass().getName()
  5. def the_inThisObject = new Throwable().getStackTrace().findAll {
  6. the_stackTraceElement ->
  7. the_thisClassName.equals(the_stackTraceElement.getClassName())
  8. }
  9. println "className = "+ the_inThisObject[0].getProperties().className
  10. println "methodName = "+ the_inThisObject[0].getProperties().methodName
  11. }
  12.  
  13. getMyInfo()
Add Comment
Please, Sign In to add comment