You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/09/10 17:38:03 UTC

[GitHub] [helix] kaisun2000 commented on a change in pull request #1355: Enhance logging for CallbackHandler and Zkclient

kaisun2000 commented on a change in pull request #1355:
URL: https://github.com/apache/helix/pull/1355#discussion_r486518801



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/CallbackHandler.java
##########
@@ -660,24 +666,31 @@ private void subscribeForChanges(NotificationContext.Type callbackType, String p
           //TODO: avoid calling getChildren for path that does not exist
           if (_changeType == CUSTOMIZED_STATE_ROOT) {
             logger.warn(
-                "Failed to subscribe child/data change on path: {}, listener: {}. Instance "
-                    + "does not support Customized State!", path, _listener);
+                "CallbackHandler {}, Failed to subscribe child/data change on path: {}, listener: {}. Instance "
+                    + "does not support Customized State!", this.toString(), path, _listener);
           } else {
-            logger.warn("Failed to subscribe child/data change. path: {}, listener: {}", path,
-                _listener, e);
+            logger.warn("CallbackHandler {}, Failed to subscribe child/data change. path: {}, listener: {}",
+                this.toString(), path, _listener, e);
           }
         }
       }
     }
 
     long end = System.currentTimeMillis();
-    logger.info("Subscribing to path: {} took: {}", path, (end - start));
+    logger.info("CallbackHandler{}, Subscribing to path: {} took: {}", this.toString(), path, (end - start));
   }
 
   public EventType[] getEventTypes() {
     return (EventType[]) _eventTypes.toArray();
   }
 
+  @Override
+  public String toString() {
+    StringBuilder stringBuilder = new StringBuilder();
+    stringBuilder.append(_uid);
+    return stringBuilder.toString();

Review comment:
       I think Lei mentioned in the review meeting not to hard code the UID. How about let me use a function called getUID()? 




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org