MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / Log

Function Log

10.16-logFunction2/main.cpp:26–35  ·  view source on GitHub ↗

#B Log now takes Format which implicitly adds source location information

Source from the content-addressed store, hash-verified

24// #B Log now takes Format which implicitly adds source location
25// information
26void Log(LogLevel level, Format fmt, const auto&... args)
27{
28 std::clog << std::format("{}:{}:{}: ",
29 static_cast<unsigned int>(level),
30 fmt.loc.function_name(),
31 fmt.loc.line())
32 << std::vformat(fmt.fmt,
33 std::make_format_args(args...))
34 << '\n';
35}
36
37int main()
38{

Callers 1

mainFunction · 0.70

Calls 1

formatFunction · 0.50

Tested by

no test coverage detected