1、获取当前类名:
Thread.currentThread().getStackTrace()[1].getClassName()
2、获取当前方法名:
Thread.currentThread().getStackTrace()[1].getMethodName()
【Java】+获取当前方法名 or 类名
原文:https://www.cnblogs.com/danhuai/p/11404033.html