diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index 95f76b138a..53aee4ec9a 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -76,13 +76,14 @@ enum LOG_LEVELS static const char LOG_LEVEL_TO_CHAR[7] = "-NEWID"; void GenericLogFmtImpl(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, - std::string_view format, const fmt::format_args& args); + fmt::string_view format, const fmt::format_args& args); -template -void GenericLogFmt(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, - std::string_view format, const Args&... args) +template +void GenericLogFmt(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, const S& format, + const Args&... args) { - GenericLogFmtImpl(level, type, file, line, format, fmt::make_format_args(args...)); + GenericLogFmtImpl(level, type, file, line, format, + fmt::make_args_checked(format, args...)); } void GenericLog(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, const char* fmt, ...) @@ -136,11 +137,11 @@ void GenericLog(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, con // fmtlib capable API -#define GENERIC_LOG_FMT(t, v, ...) \ +#define GENERIC_LOG_FMT(t, v, format, ...) \ do \ { \ if (v <= MAX_LOGLEVEL) \ - Common::Log::GenericLogFmt(v, t, __FILE__, __LINE__, __VA_ARGS__); \ + Common::Log::GenericLogFmt(v, t, __FILE__, __LINE__, FMT_STRING(format), ##__VA_ARGS__); \ } while (0) #define ERROR_LOG_FMT(t, ...) \ diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 2255fc6f8e..7e56b6426a 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -81,7 +81,7 @@ void GenericLog(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, con } void GenericLogFmtImpl(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, - std::string_view format, const fmt::format_args& args) + fmt::string_view format, const fmt::format_args& args) { auto* instance = LogManager::GetInstance(); if (instance == nullptr)