How to get method name for debug output in Android/Java?
问题 I would like to make a macro that prints out the current method's name during Log.d and Log.e output. Right now I simply type the method name within a hard-coded string, but this is obviously inefficient should the method name change in the future, as each string needs to be searched for and replaced. I am aware of using getMethodName() as indicated in this post: How to get method name in Java This one also looks promising: Debugging with helper extension method There are countless numbers of