You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2014/10/07 10:38:27 UTC

[7/9] git commit: better log for service state logic

better log for service state logic


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

Branch: refs/heads/master
Commit: 527604ed2af7482191639f6d4cdcd3d401e154d4
Parents: 55d96f1
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sat Oct 4 01:31:01 2014 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Sat Oct 4 01:31:01 2014 +0100

----------------------------------------------------------------------
 .../main/java/brooklyn/entity/basic/ServiceStateLogic.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/527604ed/core/src/main/java/brooklyn/entity/basic/ServiceStateLogic.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/ServiceStateLogic.java b/core/src/main/java/brooklyn/entity/basic/ServiceStateLogic.java
index 8b0185d..abe5d94 100644
--- a/core/src/main/java/brooklyn/entity/basic/ServiceStateLogic.java
+++ b/core/src/main/java/brooklyn/entity/basic/ServiceStateLogic.java
@@ -252,7 +252,8 @@ public class ServiceStateLogic {
             if (Boolean.TRUE.equals(serviceUp) && (problems==null || problems.isEmpty())) {
                 return Lifecycle.RUNNING;
             } else {
-                log.warn("Setting "+entity+" "+Lifecycle.ON_FIRE+" due to problems when expected running, up="+serviceUp+", problems: "+problems);
+                log.warn("Setting "+entity+" "+Lifecycle.ON_FIRE+" due to problems when expected running, up="+serviceUp+", "+
+                    (problems==null || problems.isEmpty() ? "not-up-indicators: "+entity.getAttribute(SERVICE_NOT_UP_INDICATORS) : "problems: "+problems));
                 return Lifecycle.ON_FIRE;
             }
         }
@@ -485,10 +486,11 @@ public class ServiceStateLogic {
         protected void updateMapSensor(AttributeSensor<Map<String, Object>> sensor, Object value) {
             if (log.isTraceEnabled()) log.trace("{} updating map sensor {} with {}", new Object[] { this, sensor, value });
 
-            if (value!=null)
+            if (value!=null) {
                 updateMapSensorEntry(entity, sensor, getKeyForMapSensor(), value);
-            else
+            } else {
                 clearMapSensorEntry(entity, sensor, getKeyForMapSensor());
+            }
         }
 
         /** not used; see specific `computeXxx` methods, invoked by overridden onUpdated */