Simplify log message I think
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/73fc0009 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/73fc0009 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/73fc0009 Branch: refs/heads/master Commit: 73fc000990754d37d748d012652b35e10bb494a0 Parents: 42d2453 Author: Sam Corbett <[email protected]> Authored: Mon Jul 20 12:09:43 2015 +0100 Committer: Sam Corbett <[email protected]> Committed: Mon Jul 20 12:09:43 2015 +0100 ---------------------------------------------------------------------- .../java/brooklyn/entity/effector/Effectors.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/73fc0009/core/src/main/java/brooklyn/entity/effector/Effectors.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/brooklyn/entity/effector/Effectors.java b/core/src/main/java/brooklyn/entity/effector/Effectors.java index 5d89e56..4039e67 100644 --- a/core/src/main/java/brooklyn/entity/effector/Effectors.java +++ b/core/src/main/java/brooklyn/entity/effector/Effectors.java @@ -135,12 +135,15 @@ public class Effectors { public static <T> TaskAdaptable<T> invocation(Entity entity, Effector<T> eff, @Nullable Map<?,?> parameters) { @SuppressWarnings("unchecked") Effector<T> eff2 = (Effector<T>) ((EntityInternal)entity).getEffector(eff.getName()); - if (log.isTraceEnabled()) - log.trace("invoking "+eff+"/"+ - (eff instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>)eff).getBody() : "bodyless")+ - " on entity " + entity+" "+ - (eff2==eff ? "" : " (actually "+eff2+"/"+ - (eff2 instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>)eff2).getBody() : "bodyless")+")")); + if (log.isTraceEnabled()) { + Object eff1Body = (eff instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>) eff).getBody() : "bodyless"); + String message = String.format("Invoking %s/%s on entity %s", eff, eff1Body, entity); + if (eff != eff2) { + Object eff2Body = (eff2 instanceof EffectorWithBody<?> ? ((EffectorWithBody<?>) eff2).getBody() : "bodyless"); + message += String.format(" (actually %s/%s)", eff2, eff2Body); + } + log.trace(message); + } if (eff2 != null) { if (eff2 != eff) { if (eff2 instanceof EffectorWithBody) {
