I want to add a plugin to my Eclipse(Helios) which logs my function start and end. To be more precise, I'm looking for something like this.
TestClass {
private static final Logger logger = Logger.getLog("TestClass");
public void displayHello () {
System.out.println("Fooo");
}
}
After I add the plugin and enable functional logging,Im expecting the following
TestClass {
private static final Logger logger = Logger.getLog("TestClass");
public void displayHello () {
logger.debug ("displayHello() - Started");
System.out.println("Fooo");
logger.debug ("displayHello() - Ended");
}
}
I remember using some method to obtain the same earlier but am unable to recollect the same now.Can anyone help me out with this?
Thanks Anish
You should look at AspectJ and Spring AOP its supports something like this,
execution(* com.java.test..*.*(..))
which will cover all methods in all sub-packages of project. So no need to define all methods one by one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With