You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/03/01 08:16:33 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4707: Improve logs on HAManagerImpl

DaanHoogland commented on a change in pull request #4707:
URL: https://github.com/apache/cloudstack/pull/4707#discussion_r584515416



##########
File path: server/src/main/java/org/apache/cloudstack/ha/HAManagerImpl.java
##########
@@ -156,19 +156,16 @@ public boolean transitionHAState(final HAConfig.Event event, final HAConfig haCo
             if (result) {
                 final String message = String.format("Transitioned host HA state from:%s to:%s due to event:%s for the host id:%d",
                         currentHAState, nextState, event, haConfig.getResourceId());
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace(message);
-                }
+                LOG.debug(message);

Review comment:
       Ah, that's why I asked you to move the string creation inside the if block as well.
   ```suggestion
                   if (LOG.isDebugEnabled()) {
                       final String message = String.format("Transitioned host HA state from:%s to:%s due to event:%s for the host id:%d",
                           currentHAState, nextState, event, haConfig.getResourceId());
                       LOG.debug(message);
                   }
   ```
   I see now that the message is used later in the block. I don't like this pattern, but you are right.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org