We have various functions like Stream::Printf(), and Error::SetErrorStringWithFormat(), Log::Printf(), and various others. I added functions that delegate to formatv in case people want to see some actual usage in practice.
I also converted a few various Printfs, etc to this syntax just to demonstrate what it looks like. I tried to find callsites that would illustrate how it makes things simpler, such as :
- not needing to call .c_str() and being able to pass std::string and/or StringRef directly as the argument.
- places where the same argument is printed multiple times, only having to pass it once (incidentally this fixed a spelling mistake since when passing the argument the 2nd time, there had been a typo. So this also serves as an example of how this is safer than Printf, since less code typed = fewer chances to mess up).
- places where complex format strings are constructed, such as using the printf width specifier * or PRIx64 are used and now we can simply pass whatever type we have directly, even if it's architecture dependent like size_t.
Various other uses.
Obviously a change like this is too big to do all in one pass, since it would have a roughly 100% chance of introducing new bugs and be impossible to bisect. This is basically just to get the hookups in place and have a single-digit number of illustrative use cases.