New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: Combine LOG_XXX and LOG_FMT_XXX #5512
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Hi @JaySon-Huang, @zanmato1984, @solotzg could you please take a look at this pr at your earliest convenient time? |
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/run-all-tests |
/run-all-tests |
/rebuild |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/rebuild |
1 similar comment
/rebuild |
/rebuild |
2 similar comments
/rebuild |
/rebuild |
/rebuild |
3 similar comments
/rebuild |
/rebuild |
/rebuild |
/rebuild |
3 similar comments
/rebuild |
/rebuild |
/rebuild |
/run-all-tests |
@leiysky: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/run-all-tests |
} \ | ||
} while (false) | ||
|
||
#define LOG_IMPL_CHOSER(...) TF_GET_29TH_ARG(__VA_ARGS__, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_1, LOG_IMPL_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you tell me why have 29 args?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in our repo the maximum of arguments count is 26.
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/merge |
@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 164c473
|
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
#define LOG_IMPL(logger, PRIORITY, ...) LOG_IMPL_CHOSER(__VA_ARGS__)(logger, PRIORITY, __VA_ARGS__) | ||
// clang-format on | ||
|
||
#define LOG_TRACE(logger, ...) LOG_IMPL(logger, Poco::Message::PRIO_TRACE, __VA_ARGS__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the doc:
A Message can also contain any number of named parameters that contain additional information about the event that caused the message.
Seems that we can even consider supporting named arguments (instead of fmt differently) in future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "named arguments" means a behavior like this?
int val = 12345;
LOG_DEBUG(log, "log some value"; val);
// generate a log "log some value [val=12345]"
As Poco::Message
copy the key, value to a map<string, string> then put it into the format buffer. I'm wondering whether it will bring performance regression for logging. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spdlog may be a good alternative considering performance. It also has many convenient features.
Signed-off-by: fuzhe1989 fuzhe1989@gmail.com
What problem does this PR solve?
Issue Number: ref #5511
Problem Summary:
What is changed and how it works?
Overload macros by arg count.
Check List
Tests
Side effects
Documentation
Release note