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 16:20:39 UTC

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

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


##########
src/replica/mutation_log.cpp:
##########
@@ -997,26 +996,26 @@ int64_t mutation_log::on_partition_reset(gpid gpid, decree max_decree)
         replica_log_info old_info = _private_log_info;
         _private_log_info.max_decree = max_decree;
         _private_log_info.valid_start_offset = _global_end_offset;
-        LOG_WARNING("replica %d.%d has changed private log max_decree from %" PRId64 " to %" PRId64
-                    ", valid_start_offset from %" PRId64 " to %" PRId64,
-                    gpid.get_app_id(),
-                    gpid.get_partition_index(),
-                    old_info.max_decree,
-                    _private_log_info.max_decree,
-                    old_info.valid_start_offset,
-                    _private_log_info.valid_start_offset);
+        LOG_WARNING_F("replica {}.{} has changed private log max_decree from {} to {}, "
+                      "valid_start_offset from {} to {}",
+                      gpid,
+                      gpid.get_partition_index(),
+                      old_info.max_decree,
+                      _private_log_info.max_decree,
+                      old_info.valid_start_offset,
+                      _private_log_info.valid_start_offset);

Review Comment:
   ```suggestion
           LOG_WARNING_F("replica {} has changed private log max_decree from {} to {}, "
                         "valid_start_offset from {} to {}",
                         gpid,
                         old_info.max_decree,
                         _private_log_info.max_decree,
                         old_info.valid_start_offset,
                         _private_log_info.valid_start_offset);
   ```



##########
src/replica/mutation_log.cpp:
##########
@@ -997,26 +996,26 @@ int64_t mutation_log::on_partition_reset(gpid gpid, decree max_decree)
         replica_log_info old_info = _private_log_info;
         _private_log_info.max_decree = max_decree;
         _private_log_info.valid_start_offset = _global_end_offset;
-        LOG_WARNING("replica %d.%d has changed private log max_decree from %" PRId64 " to %" PRId64
-                    ", valid_start_offset from %" PRId64 " to %" PRId64,
-                    gpid.get_app_id(),
-                    gpid.get_partition_index(),
-                    old_info.max_decree,
-                    _private_log_info.max_decree,
-                    old_info.valid_start_offset,
-                    _private_log_info.valid_start_offset);
+        LOG_WARNING_F("replica {}.{} has changed private log max_decree from {} to {}, "
+                      "valid_start_offset from {} to {}",
+                      gpid,
+                      gpid.get_partition_index(),
+                      old_info.max_decree,
+                      _private_log_info.max_decree,
+                      old_info.valid_start_offset,
+                      _private_log_info.valid_start_offset);
     } else {
         replica_log_info info(max_decree, _global_end_offset);
         auto it = _shared_log_info_map.insert(replica_log_info_map::value_type(gpid, info));
         if (!it.second) {
-            LOG_WARNING("replica %d.%d has changed shared log max_decree from %" PRId64
-                        " to %" PRId64 ", valid_start_offset from %" PRId64 " to %" PRId64,
-                        gpid.get_app_id(),
-                        gpid.get_partition_index(),
-                        it.first->second.max_decree,
-                        info.max_decree,
-                        it.first->second.valid_start_offset,
-                        info.valid_start_offset);
+            LOG_WARNING_F("replica {}.{} has changed shared log max_decree from {} to {}, "
+                          "valid_start_offset from {} to {} ",
+                          gpid,
+                          gpid.get_partition_index(),
+                          it.first->second.max_decree,
+                          info.max_decree,
+                          it.first->second.valid_start_offset,
+                          info.valid_start_offset);

Review Comment:
   ```suggestion
               LOG_WARNING_F("replica {} has changed shared log max_decree from {} to {}, "
                             "valid_start_offset from {} to {} ",
                             gpid,
                             it.first->second.max_decree,
                             info.max_decree,
                             it.first->second.valid_start_offset,
                             info.valid_start_offset);
   ```



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