获取java类和方法名

String clazz = this.getClass().getName();
String method = Thread.currentThread() .getStackTrace()[1].getMethodName();
System.out.println(clazz);
System.out.println(method);

原文地址:https://www.cnblogs.com/testway/p/5337436.html