Capturing logging entries on code coverage

841 views Asked by At

I'm using Maven Surefire plugin to run my project's unit tests and Jacoco for code coverage. I have a strict coverage criteria in my project but my problem is that logging level specific lines are not captured by the Jacoco and messing up with my covering stats. For example:

if (log.isDebugEnabled()) {
        log.debug("Log entry");
    }

Will fail to identify the log entry code line. Any way to work around it?

0

There are 0 answers