I am bored of adding manual logs for debugging each and every method that I write.
I came to know about @Loggable
annotation of jcabi but am not successful in implementing that and your help is highly appreciated.
Below is the code that I have tried.
import com.jcabi.aspects.Loggable;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class Jcabi {
@Loggable
private static String checkJcabi(String stringToPrint) {
log.info("Print Successfull");
return stringToPrint;
}
public static void main(String[] args) {
checkJcabi("Hello World!");
}
}
IDE console prints this:
[main] INFO com.amazon.optimus.cpamutil.utils.Jcabi - Print Successfull
This is the log for the log.info()
I have added in the method and there is no log for the @Loggable
annotation something like this (below) as mentioned in this post
[INFO] com.example.Foo #power(2, 10): 1024 in 12μs
[INFO] com.example.Foo #power(3, 3): 27 in 4μs
Below are the dependencies packages that I use:
JCabiAspects = 1.0;
AspectJ = 6.0;
Slf4j = 1.7;
Slf4j_Simple = 1.7;
Let me know if you need more details. Thanks.