How to automatically log the entry/exit of methods in Java?
问题 Right now I am using java.util.logging to log the entry and exit points of each method in my Java project. This is very useful to me when debugging. I have this piece of code at the beginning of each method and a similar one at the end: if (logger.isLoggable(Level.FINER)) { logger.entering(this.getClass().getName(), "methodName"); } Where "methodName" is the the name of the method (hardcoded). So I was wondering if there is a way to do this automatically without having to include this code in