common/LogEntry: Reintroduce human readable log level for clog messages#49730
common/LogEntry: Reintroduce human readable log level for clog messages#49730
Conversation
|
@tchaikov Would it be wise to implement our own struct fmt::formatter<clog_type> instead of providing a formatter inherited from ostream_formatter here ? |
|
@pdvian hi Prashant, I think it depends on if we are still using operator<< to print this type. Please note, if we have both of them if the tree is compiled with fmtlib< 9.0. Personally, I'd avoid replicate the formatting logic in two places unless one of the implementations is very readable/ simple. |
Thanks. It makes sense. |
|
@tchaikov Hi Kefu, Can you review this PR please ? |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
In {fmt} v9, fmt::formatter<> is not getting defined automatically for
the clog_type with operator<<, we need to define it explictly.
Allow fmt::formatter<> to print clog prio using {fmt}.
Fixes: https://tracker.ceph.com/issues/58436
Signed-off-by: Prashant D <pdhange@redhat.com>
|
Re-opening this PR as we are encountering this issue in teuthology tests. e.g https://pulpito.ceph.com/yuriw-2024-01-10_19:18:18-rados-wip-pdhange-testing-distro-default-smithi/7512554/ |
|
@rzarzynski @NitzanMordhai Kindly review this PR. |
Thanks Sridhar. Your PR looks good to me. I am fine to close this PR in favor of your PR. @rzarzynski @NitzanMordhai Sridhar has another PR #55455 ready to merge for the same issue. Should we go ahead with str helper function instead of defining formatter for clog_type ? |
@pdvian @rzarzynski Can both the fixes co-exist? This is only if there's a possibility that fmt version can be lower than |
|
@sseshasa , @rzarzynski , @tchaikov
Aren't we are passed this point in Squid? |
Yes, both fixes can co-exist. @rzarzynski What do you think ? |
The fmt submodule in ceph repo is having FMT_VERSION 90100 so we need to define fmt::formatter for clog_type explicitly. |
|
Teuthology test result There are no related failures. For the full report please see: https://tracker.ceph.com/projects/rados/wiki/MAIN#httpstrellocomcQFtoIRXE1971-wip-yuri4-testing-2024-03-05-0854 This is RADOS approved. |
In {fmt} v9, fmt::formatter<> is not getting defined automatically for
the clog_type with operator<<, we need to define it explictly.
Allow fmt::formatter<> to print clog prio using {fmt}.
Fixes: https://tracker.ceph.com/issues/58436
Signed-off-by: Prashant D pdhange@redhat.com
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows