Conversation
There was a problem hiding this comment.
Code Review
This pull request updates a warning message in tglobal.c to adjust the formatting of the time unit. The review feedback suggests replacing the printf call with the project's internal uWarn logging macro for better consistency and integration with the logging system, and recommends removing the parentheses around the unit 'ms'.
| } | ||
| if (cost >= 1000) { | ||
| printf("warning: get fqdn cost %" PRId64 " ms\n", cost); | ||
| printf("warning: get fqdn cost %" PRId64 " (ms)\n", cost); |
There was a problem hiding this comment.
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);There was a problem hiding this comment.
Pull request overview
This PR makes a small, user-visible adjustment to a client configuration warning emitted during FQDN discovery in the common/global configuration initialization code.
Changes:
- Tweaks the
printfwarning message formatting for the FQDN lookup time cost.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| if (cost >= 1000) { | ||
| printf("warning: get fqdn cost %" PRId64 " ms\n", cost); | ||
| printf("warning: get fqdn cost %" PRId64 " (ms)\n", cost); |
There was a problem hiding this comment.
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.
| printf("warning: get fqdn cost %" PRId64 " (ms)\n", cost); | |
| printf("warning: get fqdn cost %" PRId64 " ms\n", cost); |
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.