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 = final List<Reference.Mismatch> mismatches =
muzzle.getMismatchedReferenceSources(classLoader); muzzle.getMismatchedReferenceSources(classLoader);
if (mismatches.size() > 0) { if (mismatches.size() > 0) {
if (log.isDebugEnabled()) {
log.debug( log.debug(
"Instrumentation muzzled: {} -- {} on {}", "Instrumentation muzzled: {} -- {} on {}",
instrumentationPrimaryName, instrumentationPrimaryName,
getClass().getName(), this.getClass().getName(),
classLoader); classLoader);
} for (Reference.Mismatch mismatch : mismatches) {
for (final Reference.Mismatch mismatch : mismatches) {
log.debug("-- {}", mismatch); log.debug("-- {}", mismatch);
} }
}
} else {
log.debug(
"Applying instrumentation: {} -- {} on {}",
instrumentationPrimaryName,
this.getClass().getName(),
classLoader);
}
return mismatches.size() == 0; return mismatches.size() == 0;
} }
return true; return true;