Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/common/src/tglobal.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
tstrncpy(defaultFqdn, "localhost", TSDB_FQDN_LEN);
}
if (cost >= 1000) {
printf("warning: get fqdn cost %" PRId64 " ms\n", cost);
printf("warning: get fqdn cost %" PRId64 " (ms)\n", cost);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In this codebase, it is preferred to use the internal logging macros (such as uWarn, uError, or uInfo) instead of printf for consistency and to ensure that messages are correctly handled by the logging system. These macros automatically include appropriate log level prefixes and handle trailing newlines. Additionally, units like ms are typically not enclosed in parentheses in log messages within this project.

    uWarn("get fqdn cost %" PRId64 " ms", cost);

Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning string prints as e.g. cost 123 (ms), which is an unusual unit format and less readable than the previous 123 ms. Consider formatting as ... cost <n> ms (or ... cost <n>ms) to match common log/unit conventions and avoid looking like a missing value in parentheses.

Suggested change
printf("warning: get fqdn cost %" PRId64 " (ms)\n", cost);
printf("warning: get fqdn cost %" PRId64 " ms\n", cost);

Copilot uses AI. Check for mistakes.
}

TAOS_CHECK_RETURN(
Expand Down
Loading