#A Log function taking function, line, and variadic arguments
| 9 | |
| 10 | // #A Log function taking function, line, and variadic arguments |
| 11 | void Log(LogLevel level, |
| 12 | std::string_view functionName, |
| 13 | int line, |
| 14 | std::string_view fmt, |
| 15 | const auto&... args) |
| 16 | { |
| 17 | std::clog << std::format("{}:{}:{}: ", |
| 18 | static_cast<unsigned int>(level), |
| 19 | functionName, |
| 20 | line) |
| 21 | << std::vformat(fmt, std::make_format_args(args...)) |
| 22 | << '\n'; |
| 23 | } |
| 24 | |
| 25 | // #B Macro wrapper to call Log |
| 26 | #define LOG(level, fmt, ...) \ |