#include <stdio.h>
void someFunc(void) {
printf("%s\n"), __func__);
}
Each time the function is called it will print:
someFunc
What is the java equivalent?
I have found
(new Exception()).getStackTrace()[0].getMethodName()
And
java.lang.Thread.currentThread().getStackTrace()[1].getMethodName()
But these just seem ridiculous, is there an easier way?