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 every method.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…