acelyc111 commented on code in PR #2027:
URL:
https://github.com/apache/incubator-pegasus/pull/2027#discussion_r1613634914
##########
src/shell/commands/duplication.cpp:
##########
@@ -115,19 +124,34 @@ bool add_dup(command_executor *e, shell_context *sc,
arguments args)
}
const auto &resp = err_resp.get_value();
- fmt::print("adding duplication succeed [app: {}, remote: {}, appid: {},
dupid: "
- "{}], checkpoint: {}",
- app_name,
- remote_cluster_name,
- resp.appid,
- resp.dupid,
- is_duplicating_checkpoint);
+ fmt::print(
+ "adding duplication succeed [app_name: {}, remote_cluster_name: {},
appid: {}, dupid: "
+ "{}, is_duplicating_checkpoint: {}",
+ app_name,
+ remote_cluster_name,
+ resp.appid,
+ resp.dupid,
+ is_duplicating_checkpoint);
if (resp.__isset.remote_app_name) {
- fmt::print(", remote_app_name: {}\n", remote_app_name);
- } else {
- fmt::print("\nWARNING: meta server does NOT support specifying
remote_app_name, "
- "remote_app_name might has been specified with {}\n",
+ fmt::print(", remote_app_name: {}", resp.remote_app_name);
+ }
+
+ if (resp.__isset.remote_replica_count) {
+ fmt::print(", remote_replica_count: {}", resp.remote_replica_count);
+ }
+
+ fmt::print("]\n");
+
+ if (!resp.__isset.remote_app_name) {
+ fmt::print("WARNING: meta server does NOT support specifying
remote_app_name, "
+ "remote_app_name might has been specified with '{}'\n",
+ app_name);
+ }
+
+ if (!resp.__isset.remote_replica_count) {
+ fmt::print("WARNING: meta server does NOT support specifying
remote_replica_count, "
Review Comment:
For warning message, we can enable coloring by
https://fmt.dev/latest/api.html#terminal-color-and-text-style.
##########
src/shell/commands/duplication.cpp:
##########
@@ -87,6 +84,14 @@ bool add_dup(command_executor *e, shell_context *sc,
arguments args)
uint32_t remote_replica_count = 0;
PARSE_OPT_UINT(remote_replica_count, 0, {"-r", "--remote_replica_count"});
+ fmt::print("trying to add duplication [app_name: {}, remote_cluster_name:
{}, "
Review Comment:
We can use fmt::println to avoid adding `\n` manually.
Other places are the same.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]