AttributePollHandler: Reduce logging of recurring error

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/f25d28a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/f25d28a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/f25d28a6

Branch: refs/heads/master
Commit: f25d28a6dc1a36b50d6f42d60ce2ce50eeedc592
Parents: d9efe8d
Author: Aled Sage <aled.s...@gmail.com>
Authored: Thu Jun 5 21:18:18 2014 +0200
Committer: Aled Sage <aled.s...@gmail.com>
Committed: Fri Jun 6 16:30:35 2014 +0200

----------------------------------------------------------------------
 .../java/brooklyn/event/feed/AttributePollHandler.java | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f25d28a6/core/src/main/java/brooklyn/event/feed/AttributePollHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/event/feed/AttributePollHandler.java 
b/core/src/main/java/brooklyn/event/feed/AttributePollHandler.java
index d5ed8c6..db6d225 100644
--- a/core/src/main/java/brooklyn/event/feed/AttributePollHandler.java
+++ b/core/src/main/java/brooklyn/event/feed/AttributePollHandler.java
@@ -130,8 +130,8 @@ public class AttributePollHandler<V> implements 
PollHandler<V> {
 
     protected void logProblem(String type, Object val) {
         if (lastWasProblem && currentProblemLoggedAsWarning) {
-            if (log.isDebugEnabled())
-                log.debug("Recurring "+type+" reading " + this + " in " + 
getBriefDescription() + ": " + val);
+            if (log.isTraceEnabled())
+                log.trace("Recurring {} reading {} in {}: {}", new Object[] 
{type, this, getBriefDescription(), val});
         } else {
             long nowTime = System.currentTimeMillis();
             // get a non-volatile value
@@ -148,9 +148,7 @@ public class AttributePollHandler<V> implements 
PollHandler<V> {
                         log.debug("Trace for "+type+" reading 
"+getBriefDescription()+": "+val, (Throwable)val);
                 } else {
                     if (log.isDebugEnabled())
-                        log.debug("Read of " + getBriefDescription() + " gave 
" + type + 
-                                " (in grace period)" +
-                                ": " + val);
+                        log.debug("Read of " + getBriefDescription() + " gave 
" + type + " (in grace period): " + val);
                 }
                 lastWasProblem = true;
                 currentProblemStartTime = nowTime;
@@ -165,9 +163,8 @@ public class AttributePollHandler<V> implements 
PollHandler<V> {
                     if (log.isDebugEnabled() && val instanceof Throwable)
                         log.debug("Trace for "+type+" reading 
"+getBriefDescription()+": "+val, (Throwable)val);
                 } else {
-                    log.debug("Recurring "+type+" reading " + this + " for " + 
getBriefDescription() + 
-                            " (still in grace period)" +
-                            ": " + val);
+                    if (log.isDebugEnabled()) 
+                        log.debug("Recurring {} reading {} in {} (still in 
grace period): {}", new Object[] {type, this, getBriefDescription(), val});
                 }
             }
         }

Reply via email to