You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2023/01/18 16:32:34 UTC

[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1318: refactor(log): use LOG_ERROR_F instead of LOG_ERROR (1/2)

acelyc111 commented on code in PR #1318:
URL: https://github.com/apache/incubator-pegasus/pull/1318#discussion_r1073770884


##########
src/replica/replica_learn.cpp:
##########
@@ -1227,22 +1213,19 @@ error_code replica::handle_learning_succeeded_on_primary(::dsn::rpc_address node
 {
     auto it = _primary_states.learners.find(node);
     if (it == _primary_states.learners.end()) {
-        LOG_ERROR("%s: handle_learning_succeeded_on_primary[%016" PRIx64 "]: learner = %s, "
-                  "learner not found on primary, return ERR_LEARNER_NOT_FOUND",
-                  name(),
-                  learn_signature,
-                  node.to_string());
+        LOG_ERROR_PREFIX("handle_learning_succeeded_on_primary[{:#018x}]: learner = {}, learner "
+                         "not found on primary, return ERR_LEARNER_NOT_FOUND",
+                         learn_signature,
+                         node);
         return ERR_LEARNER_NOT_FOUND;
     }
 
     if (it->second.signature != (int64_t)learn_signature) {
-        LOG_ERROR("%s: handle_learning_succeeded_on_primary[%016" PRIx64 "]: learner = %s, "
-                  "signature not matched, current signature on primary is [%016" PRIx64
-                  "], return ERR_INVALID_STATE",
-                  name(),
-                  learn_signature,
-                  node.to_string(),
-                  it->second.signature);
+        LOG_ERROR_F("handle_learning_succeeded_on_primary[{:#018x}]: learner = {}, signature not "

Review Comment:
   Should it be `LOG_ERROR_PREFIX`?



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

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org