The cool kids are doing it with constexpr. See spdlog and/or fmt
fmt can check format strings at compile time, but does it generate code to do the formatting? Some quick experiments suggests it will re-parse the format string at runtime to do the formatting.