Optimize Instrumenter logging

This commit is contained in:
Andrew Kent 2018-07-20 16:30:02 -07:00
parent 55a0abce68
commit 0f6761dd4b
1 changed files with 13 additions and 5 deletions

View File

@ -128,15 +128,23 @@ public interface Instrumenter {
final List<Reference.Mismatch> mismatches =
muzzle.getMismatchedReferenceSources(classLoader);
if (mismatches.size() > 0) {
if (log.isDebugEnabled()) {
log.debug(
"Instrumentation muzzled: {} -- {} on {}",
instrumentationPrimaryName,
getClass().getName(),
this.getClass().getName(),
classLoader);
}
for (final Reference.Mismatch mismatch : mismatches) {
for (Reference.Mismatch mismatch : mismatches) {
log.debug("-- {}", mismatch);
}
}
} else {
log.debug(
"Applying instrumentation: {} -- {} on {}",
instrumentationPrimaryName,
this.getClass().getName(),
classLoader);
}
return mismatches.size() == 0;
}
return true;