We use SonarQube 5.1 with the Jacoco maven 0.7.4 plugin, and all of our slf4j registration protocols, such as log.debug('Something happened'), show that only 1 of 2 branches is covered. I understand that this is because slf4j internally executes if debug, which is great, but we don’t want this to drop our numbers. We are not interested in testing slf4j, and we would prefer not to run each test several times for different levels of logging.
So, how can we tell Sonar and / or Yakoko to exclude these lines from coverage? Both of them have custom file exceptions, but from what I can say, they are only intended to exclude your own classes from coverage (using the destination directory), and not from imported libraries. I still tried to add groovy.util.logging.*'to the list of exceptions, but did nothing.
logger.isDebugEnabled () kills my code coverage. I plan to exclude it when running cobertura , and he suggested that for Cobertura, the ignore property should be used instead of exclude. I do not see anything like this for Jacoco or Sonar in the settings or documentation.
EDIT: An example image from an Eclipse application after starting Jacoco coverage (Sonar shows the same in the GUI). This is the actual code from one of our classes.

EDIT 2: We use the Slf4j annotation. Docs here:
http://docs.groovy-lang.org/next/html/gapi/groovy/util/logging/Slf4j.html
This local conversion adds logging capabilities to your program using LogBack logging. Each method call for an unbound variable named log will be mapped to a registrar call. To do this, a log field will be inserted into the class. If the field already exists, using this conversion will result in a compilation error. The method name will be used to determine what needs to be called in the log.
log.name(exp)
displayed on
if (log.isNameLoggable() {
log.name(exp)
}
, , , .. exp , . .
, , . 2 ifs, , ( , ). , .