Common/LogManager: Add generic printf-style log function that takes a va_list instead of va_args.

This commit is contained in:
Admiral H. Curtiss
2022-04-09 01:41:40 +02:00
parent 120208ae03
commit 36134abd0e
2 changed files with 26 additions and 0 deletions

View File

@ -80,6 +80,22 @@ void GenericLog(LogLevel level, LogType type, const char* file, int line, const
instance->Log(level, type, file, line, message);
}
void GenericLogV(LogLevel level, LogType type, const char* file, int line, const char* fmt,
va_list args)
{
auto* instance = LogManager::GetInstance();
if (instance == nullptr)
return;
if (!instance->IsEnabled(type, level))
return;
char message[MAX_MSGLEN];
CharArrayFromFormatV(message, MAX_MSGLEN, fmt, args);
instance->Log(level, type, file, line, message);
}
void GenericLogFmtImpl(LogLevel level, LogType type, const char* file, int line,
fmt::string_view format, const fmt::format_args& args)
{