Skip to content

common/LogEntry: Reintroduce human readable log level for clog messages#49730

Merged
yuriw merged 1 commit intoceph:mainfrom
pdvian:wip-clog-fix
Mar 12, 2024
Merged

common/LogEntry: Reintroduce human readable log level for clog messages#49730
yuriw merged 1 commit intoceph:mainfrom
pdvian:wip-clog-fix

Conversation

@pdvian
Copy link
Contributor

@pdvian pdvian commented Jan 12, 2023

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

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@pdvian pdvian requested a review from tchaikov January 12, 2023 20:48
@pdvian pdvian changed the title common/LogEntry: Retroduce human readable log level for clog messages common/LogEntry: Reintroduce human readable log level for clog messages Jan 18, 2023
@pdvian
Copy link
Contributor Author

pdvian commented Jan 18, 2023

@tchaikov Would it be wise to implement our own struct fmt::formatter<clog_type> instead of providing a formatter inherited from ostream_formatter here ?

@tchaikov
Copy link
Contributor

tchaikov commented Jan 18, 2023

@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.

@pdvian
Copy link
Contributor Author

pdvian commented Jan 18, 2023

@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.

@pdvian
Copy link
Contributor Author

pdvian commented Mar 20, 2023

@tchaikov Hi Kefu, Can you review this PR please ?

@pdvian pdvian requested review from ronen-fr and rzarzynski March 20, 2023 22:36
@github-actions
Copy link

github-actions bot commented Aug 8, 2023

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.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Aug 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

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!

@github-actions github-actions bot closed this Sep 7, 2023
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>
@pdvian pdvian removed the stale label Feb 7, 2024
@pdvian
Copy link
Contributor Author

pdvian commented Feb 7, 2024

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/

@pdvian
Copy link
Contributor Author

pdvian commented Feb 7, 2024

@rzarzynski @NitzanMordhai Kindly review this PR.

@pdvian pdvian requested a review from NitzanMordhai February 7, 2024 20:48
@sseshasa
Copy link
Contributor

sseshasa commented Feb 8, 2024

Hi @pdvian, Another PR: #55455 was recently raised and reviewed to fix this. PTAL.

Copy link
Contributor

@NitzanMordhai NitzanMordhai left a comment

Choose a reason for hiding this comment

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

LGTM

@pdvian
Copy link
Contributor Author

pdvian commented Feb 15, 2024

Hi @pdvian, Another PR: #55455 was recently raised and reviewed to fix this. PTAL.

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 ?

@sseshasa
Copy link
Contributor

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 90000. Otherwise, I am fine with whatever you think is the best fix.

@ronen-fr
Copy link
Contributor

@sseshasa , @rzarzynski , @tchaikov

@pdvian @rzarzynski Can both the fixes co-exist? This is only if there's a possibility that fmt version can be lower than 90000. Otherwise, I am fine with whatever you think is the best fix.

Aren't we are passed this point in Squid?

@pdvian
Copy link
Contributor Author

pdvian commented Feb 22, 2024

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 90000. Otherwise, I am fine with whatever you think is the best fix.

Yes, both fixes can co-exist. @rzarzynski What do you think ?

@pdvian
Copy link
Contributor Author

pdvian commented Feb 22, 2024

@sseshasa , @rzarzynski , @tchaikov

@pdvian @rzarzynski Can both the fixes co-exist? This is only if there's a possibility that fmt version can be lower than 90000. Otherwise, I am fine with whatever you think is the best fix.

Aren't we are passed this point in Squid?

The fmt submodule in ceph repo is having FMT_VERSION 90100 so we need to define fmt::formatter for clog_type explicitly.

@sseshasa
Copy link
Contributor

Copy link
Contributor

@sseshasa sseshasa left a comment

Choose a reason for hiding this comment

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

LGTM

@yuriw yuriw merged commit 08fe40f into ceph:main Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants