create AgentBuilder instance with logging listeners only if debug mode is enabled
This commit is contained in:
parent
e4a454549d
commit
b7b46caaa8
|
@ -58,10 +58,8 @@ public class AgentInstaller {
|
|||
new AgentBuilder.Default()
|
||||
.disableClassFormatChanges()
|
||||
.with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
|
||||
.with(new RedefinitionLoggingListener())
|
||||
.with(AgentBuilder.DescriptionStrategy.Default.POOL_ONLY)
|
||||
.with(AgentTooling.poolStrategy())
|
||||
.with(new TransformLoggingListener())
|
||||
.with(new ClassLoadListener())
|
||||
.with(AgentTooling.locationStrategy())
|
||||
// FIXME: we cannot enable it yet due to BB/JVM bug, see
|
||||
|
@ -139,6 +137,14 @@ public class AgentInstaller {
|
|||
.or(isAnnotatedWith(named("javax.decorator.Decorator")))
|
||||
.or(matchesConfiguredExcludes());
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
agentBuilder =
|
||||
agentBuilder
|
||||
.with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
|
||||
.with(new RedefinitionLoggingListener())
|
||||
.with(new TransformLoggingListener());
|
||||
}
|
||||
|
||||
for (final AgentBuilder.Listener listener : listeners) {
|
||||
agentBuilder = agentBuilder.with(listener);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue