You will be having many methods in your application framework, and if want to trace and log current method name then the below code will be helpful for you.
def getCurrentMethodName:String = Thread.currentThread.getStackTrace()(2).getMethodName def test{ println("you are in - "+getCurrentMethodName) println("this is doing some functionality") } test
Output:
you are in – test
this is doing some functionality