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/17 17:15:28 UTC

[GitHub] [incubator-pegasus] neverchanje commented on a diff in pull request #1315: refactor(log): use LOG_WARNING_F instead of LOG_WARNING (1/3)

neverchanje commented on code in PR #1315:
URL: https://github.com/apache/incubator-pegasus/pull/1315#discussion_r1072495044


##########
src/replica/replica_check.cpp:
##########
@@ -160,12 +158,12 @@ void replica::on_group_check(const group_check_request &request,
 
     if (request.config.ballot < get_ballot()) {
         response.err = ERR_VERSION_OUTDATED;
-        LOG_WARNING("%s: on_group_check reply %s", name(), response.err.to_string());
+        LOG_WARNING_PREFIX("on_group_check reply {}", response.err);

Review Comment:
   ```suggestion
           LOG_WARNING_F("on_group_check reply {}", response.err);
   ```
   



##########
src/replica/replica_check.cpp:
##########
@@ -199,7 +197,7 @@ void replica::on_group_check(const group_check_request &request,
     response.err = ERR_OK;
     if (status() == partition_status::PS_ERROR) {
         response.err = ERR_INVALID_STATE;
-        LOG_WARNING("%s: on_group_check reply %s", name(), response.err.to_string());
+        LOG_WARNING_PREFIX("on_group_check reply {}", response.err);

Review Comment:
   ```suggestion
           LOG_WARNING_F("on_group_check reply {}", response.err);
   ```
   



##########
src/replica/replica_check.cpp:
##########
@@ -160,12 +158,12 @@ void replica::on_group_check(const group_check_request &request,
 
     if (request.config.ballot < get_ballot()) {
         response.err = ERR_VERSION_OUTDATED;
-        LOG_WARNING("%s: on_group_check reply %s", name(), response.err.to_string());
+        LOG_WARNING_PREFIX("on_group_check reply {}", response.err);
         return;
     } else if (request.config.ballot > get_ballot()) {
         if (!update_local_configuration(request.config)) {
             response.err = ERR_INVALID_STATE;
-            LOG_WARNING("%s: on_group_check reply %s", name(), response.err.to_string());
+            LOG_WARNING_PREFIX("on_group_check reply {}", response.err);

Review Comment:
   ```suggestion
               LOG_WARNING_F("on_group_check reply {}", response.err);
   ```
   



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