Building on clang-tidy to Move From printf-style to std::print-style Logging and Beyond
summary
Migrates C printf-style logging to libfmt's fmt::printf then to fmt::print/std::print using custom clang-tidy checks that convert format strings, add casts for sign/width quirks, and run automated fixes and lit tests; the tooling changes 7,000 lines across ~440 files, lands a modified clang-tidy modernize-use-std-print check upstream, uncovers a unit-test crash caused by exception handling and narrows it with git bisect, and proves the conversion workflow works with some remaining macro and template edge cases.
AI-written summary · about
chapters (13)
- 0:00Introduction and context
- 2:08Legacy logging challenges
- 5:43Format type safety issues
- 8:52Transitioning to {fmt}
- 11:49Getting started with clang-tidy
- 16:44Custom clang-tidy checkers
- 20:00Printf to std::print conversion
- 28:43Applying bulk code changes
- 30:51Debugging refactoring errors
- 33:58Future logging improvements
- 35:31Standardizing helper functions
- 37:26Advanced clang-tidy challenges
- 38:59Reflections on tool development








