[Java] Get the method name of the current method

Sometimes you need to know the method name of the currently executed method. The method is as follows:

String method = Thread.currentThread().getStackTrace()[1].getMethodName();

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325819179&siteId=291194637