I'm trying to write a logger that can take arguments the same way that printf does with formatting supported. I'm planning to just call std::format on the input to my logger, but I need to forward the variadic args to std::format. How can I do that?
What I want it too look like:
void log(const std::string& msg)
{
std::cout << msg << std::endl; // I'm actually wrapping another logger here, this is just an example.
}
void log(const std::string& fmt_string ...);
{
std::string msg = std::format(gmt_string, ...);
log(msg);
}