Created
September 2, 2015 08:52
-
-
Save relax-more/7a47798b9fcdad74ce9c to your computer and use it in GitHub Desktop.
Loggable annotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://aspects.jcabi.com/apidocs-0.22/com/jcabi/aspects/Loggable.html | |
Can just add @Loggable to private methods that we want to log. | |
I tried it out and got output like this | |
something | |
16:02:43.085 [Test worker] INFO c.l.s.c.aspects.impl.TimedAspectTest - #doSomething(): in 1.30ms | |
something | |
16:02:43.086 [Test worker] INFO c.l.s.c.aspects.impl.TimedAspectTest - #doSomething(): in 121.78µs | |
for maven, I think you add this | |
<project> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>com.jcabi</groupId> | |
<artifactId>jcabi-maven-plugin</artifactId> | |
<version>0.13.2</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>ajc</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> | |
and | |
<dependency> | |
<groupId>com.jcabi</groupId> | |
<artifactId>jcabi-aspects</artifactId> | |
<version>0.22</version> | |
</dependency> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment