diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index 98d420bda2..5a0d2c6e24 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -96,58 +96,8 @@ void GenericLogFmt(LogLevel level, LogType type, const char* file, int line, con "too many arguments?"); GenericLogFmtImpl(level, type, file, line, format, fmt::make_format_args(args...)); } - -void GenericLog(LogLevel level, LogType type, const char* file, int line, const char* fmt, ...) -#ifdef __GNUC__ - __attribute__((format(printf, 5, 6))) -#endif - ; - -void GenericLogV(LogLevel level, LogType type, const char* file, int line, const char* fmt, - va_list args); } // namespace Common::Log -// Let the compiler optimize this out -#define GENERIC_LOG(t, v, ...) \ - do \ - { \ - if (v <= Common::Log::MAX_LOGLEVEL) \ - Common::Log::GenericLog(v, t, __FILE__, __LINE__, __VA_ARGS__); \ - } while (0) - -#define ERROR_LOG(t, ...) \ - do \ - { \ - GENERIC_LOG(Common::Log::LogType::t, Common::Log::LogLevel::LERROR, __VA_ARGS__); \ - } while (0) -#define WARN_LOG(t, ...) \ - do \ - { \ - GENERIC_LOG(Common::Log::LogType::t, Common::Log::LogLevel::LWARNING, __VA_ARGS__); \ - } while (0) -#define NOTICE_LOG(t, ...) \ - do \ - { \ - GENERIC_LOG(Common::Log::LogType::t, Common::Log::LogLevel::LNOTICE, __VA_ARGS__); \ - } while (0) -#define INFO_LOG(t, ...) \ - do \ - { \ - GENERIC_LOG(Common::Log::LogType::t, Common::Log::LogLevel::LINFO, __VA_ARGS__); \ - } while (0) -#define DEBUG_LOG(t, ...) \ - do \ - { \ - GENERIC_LOG(Common::Log::LogType::t, Common::Log::LogLevel::LDEBUG, __VA_ARGS__); \ - } while (0) - -#define GENERIC_LOG_V(t, v, fmt, args) \ - do \ - { \ - if (v <= Common::Log::MAX_LOGLEVEL) \ - Common::Log::GenericLogV(v, t, __FILE__, __LINE__, fmt, args); \ - } while (0) - // fmtlib capable API #define GENERIC_LOG_FMT(t, v, format, ...) \ diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index bed3a183e4..ab795d372a 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -62,40 +62,6 @@ private: bool m_enable; }; -void GenericLog(LogLevel level, LogType type, const char* file, int line, const char* fmt, ...) -{ - auto* instance = LogManager::GetInstance(); - if (instance == nullptr) - return; - - if (!instance->IsEnabled(type, level)) - return; - - va_list args; - va_start(args, fmt); - char message[MAX_MSGLEN]; - CharArrayFromFormatV(message, MAX_MSGLEN, fmt, args); - va_end(args); - - 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) {