jcabi / jcabi-aspects

Collection of AspectJ Java Aspects to facilitate aspect-oriented programming patterns: logging, caching, validating, etc.
https://aspects.jcabi.com
Other
530 stars 150 forks source link

logging twice #243

Open lessmor opened 7 years ago

lessmor commented 7 years ago

Add the annoation :@loggable to my test project, which caused printing log twice.

  1. test code(static method) as follows:
  @Loggable(limit = 200, unit = TimeUnit.MILLISECONDS)
    public static void run() throws InterruptedException{
        TimeUnit.MILLISECONDS.sleep(300);
        // Something that should not take more than 200 msec.
    }

2.log result:

13:51:42.489 [main] WARN  com.test.aspectj.LoggableObject - #run(): in 299.59ms (too slow!)
13:51:42.489 [main] WARN  com.test.aspectj.LoggableObject - #run(): in 299.59ms (too slow!)
0crat commented 7 years ago

@yegor256 please, pay attention to this issue

yegor256 commented 7 years ago

@lessmor are you sure you don't call run() two times?