diff --git a/src/common/dynamic_library.cpp b/src/common/dynamic_library.cpp index 223b29639..fc441e7f4 100644 --- a/src/common/dynamic_library.cpp +++ b/src/common/dynamic_library.cpp @@ -22,7 +22,7 @@ #endif #endif -Log_SetChannel(DynamicLibrary); +LOG_CHANNEL(DynamicLibrary); DynamicLibrary::DynamicLibrary() = default; diff --git a/src/common/file_system.cpp b/src/common/file_system.cpp index b02259543..e05fc10a0 100644 --- a/src/common/file_system.cpp +++ b/src/common/file_system.cpp @@ -45,7 +45,7 @@ #include #endif -Log_SetChannel(FileSystem); +LOG_CHANNEL(FileSystem); #ifndef __ANDROID__ diff --git a/src/common/log.cpp b/src/common/log.cpp index f77973e34..e6ff17134 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -38,30 +38,30 @@ static void RegisterCallback(CallbackFunctionType callbackFunction, void* pUserP const std::unique_lock& lock); static void UnregisterCallback(CallbackFunctionType callbackFunction, void* pUserParam, const std::unique_lock& lock); -static bool FilterTest(LOGLEVEL level, const char* channelName, const std::unique_lock& lock); -static void ExecuteCallbacks(const char* channelName, const char* functionName, LOGLEVEL level, - std::string_view message, const std::unique_lock& lock); +static bool FilterTest(Level level, const char* channelName, const std::unique_lock& lock); +static void ExecuteCallbacks(const char* channelName, const char* functionName, Level level, std::string_view message, + const std::unique_lock& lock); static void FormatLogMessageForDisplay(fmt::memory_buffer& buffer, const char* channelName, const char* functionName, - LOGLEVEL level, std::string_view message, bool timestamp, bool ansi_color_code, + Level level, std::string_view message, bool timestamp, bool ansi_color_code, bool newline); -static void ConsoleOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, - LOGLEVEL level, std::string_view message); -static void DebugOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, +static void ConsoleOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, Level level, + std::string_view message); +static void DebugOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, Level level, std::string_view message); -static void FileOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, +static void FileOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, Level level, std::string_view message); template -static void FormatLogMessageAndPrint(const char* channelName, const char* functionName, LOGLEVEL level, +static void FormatLogMessageAndPrint(const char* channelName, const char* functionName, Level level, std::string_view message, bool timestamp, bool ansi_color_code, bool newline, const T& callback); #ifdef _WIN32 template -static void FormatLogMessageAndPrintW(const char* channelName, const char* functionName, LOGLEVEL level, +static void FormatLogMessageAndPrintW(const char* channelName, const char* functionName, Level level, std::string_view message, bool timestamp, bool ansi_color_code, bool newline, const T& callback); #endif -static const char s_log_level_characters[LOGLEVEL_COUNT] = {'X', 'E', 'W', 'I', 'V', 'D', 'B', 'T'}; +static const char s_log_level_characters[static_cast(Level::Count)] = {'X', 'E', 'W', 'I', 'V', 'D', 'B', 'T'}; static std::vector s_callbacks; static std::mutex s_callback_mutex; @@ -69,9 +69,9 @@ static std::mutex s_callback_mutex; static Common::Timer::Value s_start_timestamp = Common::Timer::GetCurrentValue(); static std::string s_log_filter; -static LOGLEVEL s_log_level = LOGLEVEL_TRACE; +static Level s_log_level = Level::None; static bool s_console_output_enabled = false; -static bool s_console_output_timestamps = true; +static bool s_console_output_timestamps = false; static bool s_file_output_enabled = false; static bool s_file_output_timestamp = false; static bool s_debug_output_enabled = false; @@ -154,7 +154,7 @@ bool Log::IsDebugOutputEnabled() return s_debug_output_enabled; } -void Log::ExecuteCallbacks(const char* channelName, const char* functionName, LOGLEVEL level, std::string_view message, +void Log::ExecuteCallbacks(const char* channelName, const char* functionName, Level level, std::string_view message, const std::unique_lock& lock) { for (RegisteredCallback& callback : s_callbacks) @@ -162,22 +162,22 @@ void Log::ExecuteCallbacks(const char* channelName, const char* functionName, LO } ALWAYS_INLINE_RELEASE void Log::FormatLogMessageForDisplay(fmt::memory_buffer& buffer, const char* channelName, - const char* functionName, LOGLEVEL level, + const char* functionName, Level level, std::string_view message, bool timestamp, bool ansi_color_code, bool newline) { - static constexpr std::string_view s_ansi_color_codes[LOGLEVEL_COUNT] = { - "\033[0m"sv, // NONE - "\033[1;31m"sv, // ERROR - "\033[1;33m"sv, // WARNING - "\033[1;37m"sv, // INFO - "\033[1;32m"sv, // VERBOSE - "\033[0;37m"sv, // DEV - "\033[0;32m"sv, // DEBUG - "\033[0;34m"sv, // TRACE + static constexpr std::string_view s_ansi_color_codes[static_cast(Level::Count)] = { + "\033[0m"sv, // None + "\033[1;31m"sv, // Error + "\033[1;33m"sv, // Warning + "\033[1;37m"sv, // Info + "\033[1;32m"sv, // Verbose + "\033[0;37m"sv, // Dev + "\033[0;32m"sv, // Debug + "\033[0;34m"sv, // Trace }; - std::string_view color_start = ansi_color_code ? s_ansi_color_codes[level] : ""sv; + std::string_view color_start = ansi_color_code ? s_ansi_color_codes[static_cast(level)] : ""sv; std::string_view color_end = ansi_color_code ? s_ansi_color_codes[0] : ""sv; std::string_view message_end = newline ? "\n"sv : ""sv; @@ -190,34 +190,34 @@ ALWAYS_INLINE_RELEASE void Log::FormatLogMessageForDisplay(fmt::memory_buffer& b if (functionName) { - fmt::format_to(appender, "[{:10.4f}] {}{}({}): {}{}{}", message_time, color_start, s_log_level_characters[level], - functionName, message, color_end, message_end); + fmt::format_to(appender, "[{:10.4f}] {}{}({}): {}{}{}", message_time, color_start, + s_log_level_characters[static_cast(level)], functionName, message, color_end, message_end); } else { - fmt::format_to(appender, "[{:10.4f}] {}{}/{}: {}{}{}", message_time, color_start, s_log_level_characters[level], - channelName, message, color_end, message_end); + fmt::format_to(appender, "[{:10.4f}] {}{}/{}: {}{}{}", message_time, color_start, + s_log_level_characters[static_cast(level)], channelName, message, color_end, message_end); } } else { if (functionName) { - fmt::format_to(appender, "{}{}({}): {}{}{}", color_start, s_log_level_characters[level], functionName, message, - color_end, message_end); + fmt::format_to(appender, "{}{}({}): {}{}{}", color_start, s_log_level_characters[static_cast(level)], + functionName, message, color_end, message_end); } else { - fmt::format_to(appender, "{}{}/{}: {}{}{}", color_start, s_log_level_characters[level], channelName, message, - color_end, message_end); + fmt::format_to(appender, "{}{}/{}: {}{}{}", color_start, s_log_level_characters[static_cast(level)], + channelName, message, color_end, message_end); } } } template -ALWAYS_INLINE_RELEASE void Log::FormatLogMessageAndPrint(const char* channelName, const char* functionName, - LOGLEVEL level, std::string_view message, bool timestamp, - bool ansi_color_code, bool newline, const T& callback) +ALWAYS_INLINE_RELEASE void Log::FormatLogMessageAndPrint(const char* channelName, const char* functionName, Level level, + std::string_view message, bool timestamp, bool ansi_color_code, + bool newline, const T& callback) { fmt::memory_buffer buffer; Log::FormatLogMessageForDisplay(buffer, channelName, functionName, level, message, timestamp, ansi_color_code, @@ -229,7 +229,7 @@ ALWAYS_INLINE_RELEASE void Log::FormatLogMessageAndPrint(const char* channelName template ALWAYS_INLINE_RELEASE void Log::FormatLogMessageAndPrintW(const char* channelName, const char* functionName, - LOGLEVEL level, std::string_view message, bool timestamp, + Level level, std::string_view message, bool timestamp, bool ansi_color_code, bool newline, const T& callback) { fmt::memory_buffer buffer; @@ -274,7 +274,7 @@ static bool EnableVirtualTerminalProcessing(HANDLE hConsole) #endif -void Log::ConsoleOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, +void Log::ConsoleOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, Level level, std::string_view message) { if (!s_console_output_enabled) @@ -283,7 +283,7 @@ void Log::ConsoleOutputLogCallback(void* pUserParam, const char* channelName, co #if defined(_WIN32) FormatLogMessageAndPrintW(channelName, functionName, level, message, s_console_output_timestamps, true, true, [level](const std::wstring_view& message) { - HANDLE hOutput = (level <= LOGLEVEL_WARNING) ? s_hConsoleStdErr : s_hConsoleStdOut; + HANDLE hOutput = (level <= Level::Warning) ? s_hConsoleStdErr : s_hConsoleStdOut; DWORD chars_written; WriteConsoleW(hOutput, message.data(), static_cast(message.length()), &chars_written, nullptr); @@ -291,13 +291,13 @@ void Log::ConsoleOutputLogCallback(void* pUserParam, const char* channelName, co #elif !defined(__ANDROID__) FormatLogMessageAndPrint(channelName, functionName, level, message, s_console_output_timestamps, true, true, [level](std::string_view message) { - const int outputFd = (level <= LOGLEVEL_WARNING) ? STDERR_FILENO : STDOUT_FILENO; + const int outputFd = (level <= Log::Level::Warning) ? STDERR_FILENO : STDOUT_FILENO; write(outputFd, message.data(), message.length()); }); #endif } -void Log::DebugOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, +void Log::DebugOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, Level level, std::string_view message) { if (!s_debug_output_enabled) @@ -310,21 +310,19 @@ void Log::DebugOutputLogCallback(void* pUserParam, const char* channelName, cons if (message.empty()) return; - static constexpr int logPriority[LOGLEVEL_COUNT] = { - ANDROID_LOG_INFO, // NONE - ANDROID_LOG_ERROR, // ERROR - ANDROID_LOG_WARN, // WARNING - ANDROID_LOG_INFO, // PERF - ANDROID_LOG_INFO, // INFO - ANDROID_LOG_INFO, // VERBOSE - ANDROID_LOG_DEBUG, // DEV - ANDROID_LOG_DEBUG, // PROFILE - ANDROID_LOG_DEBUG, // DEBUG - ANDROID_LOG_DEBUG, // TRACE + static constexpr int logPriority[static_cast(Level::Count)] = { + ANDROID_LOG_INFO, // None + ANDROID_LOG_ERROR, // Error + ANDROID_LOG_WARN, // Warning + ANDROID_LOG_INFO, // Info + ANDROID_LOG_INFO, // Verbose + ANDROID_LOG_DEBUG, // Dev + ANDROID_LOG_DEBUG, // Debug + ANDROID_LOG_DEBUG, // Trace }; - __android_log_print(logPriority[level], channelName, "%.*s", static_cast(message.length()), message.data()); -#else + __android_log_print(logPriority[static_cast(level)], channelName, "%.*s", static_cast(message.length()), + message.data()); #endif } @@ -421,7 +419,7 @@ void Log::SetDebugOutputParams(bool enabled) UnregisterCallback(DebugOutputLogCallback, nullptr, lock); } -void Log::FileOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, +void Log::FileOutputLogCallback(void* pUserParam, const char* channelName, const char* functionName, Level level, std::string_view message) { if (!s_file_output_enabled) @@ -444,7 +442,7 @@ void Log::SetFileOutputParams(bool enabled, const char* filename, bool timestamp s_file_handle.reset(FileSystem::OpenCFile(filename, "wb")); if (!s_file_handle) [[unlikely]] { - ExecuteCallbacks("Log", __FUNCTION__, LOGLEVEL_ERROR, + ExecuteCallbacks("Log", __FUNCTION__, Level::Error, TinyString::from_format("Failed to open log file '{}'", filename), lock); return; } @@ -461,12 +459,12 @@ void Log::SetFileOutputParams(bool enabled, const char* filename, bool timestamp s_file_output_timestamp = timestamps; } -LOGLEVEL Log::GetLogLevel() +Log::Level Log::GetLogLevel() { return s_log_level; } -bool Log::IsLogVisible(LOGLEVEL level, const char* channelName) +bool Log::IsLogVisible(Level level, const char* channelName) { if (level > s_log_level) return false; @@ -475,10 +473,10 @@ bool Log::IsLogVisible(LOGLEVEL level, const char* channelName) return FilterTest(level, channelName, lock); } -void Log::SetLogLevel(LOGLEVEL level) +void Log::SetLogLevel(Level level) { std::unique_lock lock(s_callback_mutex); - DebugAssert(level < LOGLEVEL_COUNT); + DebugAssert(level < Level::Count); s_log_level = level; } @@ -489,13 +487,13 @@ void Log::SetLogFilter(std::string_view filter) s_log_filter = filter; } -ALWAYS_INLINE_RELEASE bool Log::FilterTest(LOGLEVEL level, const char* channelName, +ALWAYS_INLINE_RELEASE bool Log::FilterTest(Level level, const char* channelName, const std::unique_lock& lock) { return (level <= s_log_level && s_log_filter.find(channelName) == std::string::npos); } -void Log::Write(const char* channelName, LOGLEVEL level, std::string_view message) +void Log::Write(const char* channelName, Level level, std::string_view message) { std::unique_lock lock(s_callback_mutex); if (!FilterTest(level, channelName, lock)) @@ -504,7 +502,7 @@ void Log::Write(const char* channelName, LOGLEVEL level, std::string_view messag ExecuteCallbacks(channelName, nullptr, level, message, lock); } -void Log::Write(const char* channelName, const char* functionName, LOGLEVEL level, std::string_view message) +void Log::Write(const char* channelName, const char* functionName, Level level, std::string_view message) { std::unique_lock lock(s_callback_mutex); if (!FilterTest(level, channelName, lock)) @@ -513,7 +511,7 @@ void Log::Write(const char* channelName, const char* functionName, LOGLEVEL leve ExecuteCallbacks(channelName, functionName, level, message, lock); } -void Log::WriteFmtArgs(const char* channelName, LOGLEVEL level, fmt::string_view fmt, fmt::format_args args) +void Log::WriteFmtArgs(const char* channelName, Level level, fmt::string_view fmt, fmt::format_args args) { std::unique_lock lock(s_callback_mutex); if (!FilterTest(level, channelName, lock)) @@ -525,7 +523,7 @@ void Log::WriteFmtArgs(const char* channelName, LOGLEVEL level, fmt::string_view ExecuteCallbacks(channelName, nullptr, level, std::string_view(buffer.data(), buffer.size()), lock); } -void Log::WriteFmtArgs(const char* channelName, const char* functionName, LOGLEVEL level, fmt::string_view fmt, +void Log::WriteFmtArgs(const char* channelName, const char* functionName, Level level, fmt::string_view fmt, fmt::format_args args) { std::unique_lock lock(s_callback_mutex); diff --git a/src/common/log.h b/src/common/log.h index 66b6d43bd..43d4b7798 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -12,24 +12,24 @@ #include #include -enum LOGLEVEL +namespace Log { +enum class Level { - LOGLEVEL_NONE, // Silences all log traffic - LOGLEVEL_ERROR, - LOGLEVEL_WARNING, - LOGLEVEL_INFO, - LOGLEVEL_VERBOSE, - LOGLEVEL_DEV, - LOGLEVEL_DEBUG, - LOGLEVEL_TRACE, + None, // Silences all log traffic + Error, + Warning, + Info, + Verbose, + Dev, + Debug, + Trace, - LOGLEVEL_COUNT + Count }; -namespace Log { // log message callback type -using CallbackFunctionType = void (*)(void* pUserParam, const char* channelName, const char* functionName, - LOGLEVEL level, std::string_view message); +using CallbackFunctionType = void (*)(void* pUserParam, const char* channelName, const char* functionName, Level level, + std::string_view message); // registers a log callback void RegisterCallback(CallbackFunctionType callbackFunction, void* pUserParam); @@ -53,43 +53,43 @@ void SetDebugOutputParams(bool enabled); void SetFileOutputParams(bool enabled, const char* filename, bool timestamps = true); // Returns the current global filtering level. -LOGLEVEL GetLogLevel(); +Level GetLogLevel(); // Returns true if log messages for the specified log level/filter would not be filtered (and visible). -bool IsLogVisible(LOGLEVEL level, const char* channelName); +bool IsLogVisible(Level level, const char* channelName); // Sets global filtering level, messages below this level won't be sent to any of the logging sinks. -void SetLogLevel(LOGLEVEL level); +void SetLogLevel(Level level); // Sets global filter, any messages from these channels won't be sent to any of the logging sinks. void SetLogFilter(std::string_view filter); // writes a message to the log -void Write(const char* channelName, LOGLEVEL level, std::string_view message); -void Write(const char* channelName, const char* functionName, LOGLEVEL level, std::string_view message); -void WriteFmtArgs(const char* channelName, LOGLEVEL level, fmt::string_view fmt, fmt::format_args args); -void WriteFmtArgs(const char* channelName, const char* functionName, LOGLEVEL level, fmt::string_view fmt, +void Write(const char* channelName, Level level, std::string_view message); +void Write(const char* channelName, const char* functionName, Level level, std::string_view message); +void WriteFmtArgs(const char* channelName, Level level, fmt::string_view fmt, fmt::format_args args); +void WriteFmtArgs(const char* channelName, const char* functionName, Level level, fmt::string_view fmt, fmt::format_args args); -ALWAYS_INLINE static void FastWrite(const char* channelName, LOGLEVEL level, std::string_view message) +ALWAYS_INLINE static void FastWrite(const char* channelName, Level level, std::string_view message) { if (level <= GetLogLevel()) [[unlikely]] Write(channelName, level, message); } -ALWAYS_INLINE static void FastWrite(const char* channelName, const char* functionName, LOGLEVEL level, +ALWAYS_INLINE static void FastWrite(const char* channelName, const char* functionName, Level level, std::string_view message) { if (level <= GetLogLevel()) [[unlikely]] Write(channelName, functionName, level, message); } template -ALWAYS_INLINE static void FastWrite(const char* channelName, LOGLEVEL level, fmt::format_string fmt, T&&... args) +ALWAYS_INLINE static void FastWrite(const char* channelName, Level level, fmt::format_string fmt, T&&... args) { if (level <= GetLogLevel()) [[unlikely]] WriteFmtArgs(channelName, level, fmt, fmt::make_format_args(args...)); } template -ALWAYS_INLINE static void FastWrite(const char* channelName, const char* functionName, LOGLEVEL level, +ALWAYS_INLINE static void FastWrite(const char* channelName, const char* functionName, Level level, fmt::format_string fmt, T&&... args) { if (level <= GetLogLevel()) [[unlikely]] @@ -98,17 +98,17 @@ ALWAYS_INLINE static void FastWrite(const char* channelName, const char* functio } // namespace Log // log wrappers -#define Log_SetChannel(ChannelName) [[maybe_unused]] static const char* ___LogChannel___ = #ChannelName; +#define LOG_CHANNEL(name) [[maybe_unused]] static const char* ___LogChannel___ = #name; -#define ERROR_LOG(...) Log::FastWrite(___LogChannel___, __func__, LOGLEVEL_ERROR, __VA_ARGS__) -#define WARNING_LOG(...) Log::FastWrite(___LogChannel___, __func__, LOGLEVEL_WARNING, __VA_ARGS__) -#define INFO_LOG(...) Log::FastWrite(___LogChannel___, LOGLEVEL_INFO, __VA_ARGS__) -#define VERBOSE_LOG(...) Log::FastWrite(___LogChannel___, LOGLEVEL_VERBOSE, __VA_ARGS__) -#define DEV_LOG(...) Log::FastWrite(___LogChannel___, LOGLEVEL_DEV, __VA_ARGS__) +#define ERROR_LOG(...) Log::FastWrite(___LogChannel___, __func__, Log::Level::Error, __VA_ARGS__) +#define WARNING_LOG(...) Log::FastWrite(___LogChannel___, __func__, Log::Level::Warning, __VA_ARGS__) +#define INFO_LOG(...) Log::FastWrite(___LogChannel___, Log::Level::Info, __VA_ARGS__) +#define VERBOSE_LOG(...) Log::FastWrite(___LogChannel___, Log::Level::Verbose, __VA_ARGS__) +#define DEV_LOG(...) Log::FastWrite(___LogChannel___, Log::Level::Dev, __VA_ARGS__) #ifdef _DEBUG -#define DEBUG_LOG(...) Log::FastWrite(___LogChannel___, LOGLEVEL_DEBUG, __VA_ARGS__) -#define TRACE_LOG(...) Log::FastWrite(___LogChannel___, LOGLEVEL_TRACE, __VA_ARGS__) +#define DEBUG_LOG(...) Log::FastWrite(___LogChannel___, Log::Level::Debug, __VA_ARGS__) +#define TRACE_LOG(...) Log::FastWrite(___LogChannel___, Log::Level::Trace, __VA_ARGS__) #else #define DEBUG_LOG(...) \ do \ diff --git a/src/common/memmap.cpp b/src/common/memmap.cpp index b9673ff39..0583b6592 100644 --- a/src/common/memmap.cpp +++ b/src/common/memmap.cpp @@ -35,7 +35,7 @@ #include #endif -Log_SetChannel(MemMap); +LOG_CHANNEL(MemMap); namespace MemMap { /// Allocates RWX memory at the specified address. diff --git a/src/common/progress_callback.cpp b/src/common/progress_callback.cpp index 2c35595f4..50c756e4f 100644 --- a/src/common/progress_callback.cpp +++ b/src/common/progress_callback.cpp @@ -9,7 +9,7 @@ #include #include -Log_SetChannel(ProgressCallback); +LOG_CHANNEL(ProgressCallback); static ProgressCallback s_nullProgressCallbacks; ProgressCallback* ProgressCallback::NullProgressCallback = &s_nullProgressCallbacks; diff --git a/src/common/threading.cpp b/src/common/threading.cpp index 3cd6839ac..3ee9f4c94 100644 --- a/src/common/threading.cpp +++ b/src/common/threading.cpp @@ -41,7 +41,7 @@ #endif #endif -Log_SetChannel(Threading); +LOG_CHANNEL(Threading); #ifdef _WIN32 union FileTimeU64Union diff --git a/src/core/achievements.cpp b/src/core/achievements.cpp index e904d7d96..ecddc9c23 100644 --- a/src/core/achievements.cpp +++ b/src/core/achievements.cpp @@ -52,7 +52,7 @@ #include #include -Log_SetChannel(Achievements); +LOG_CHANNEL(Achievements); #ifdef ENABLE_RAINTEGRATION // RA_Interface ends up including windows.h, with its silly macros. diff --git a/src/core/analog_controller.cpp b/src/core/analog_controller.cpp index 6acef24be..47aa2cdbb 100644 --- a/src/core/analog_controller.cpp +++ b/src/core/analog_controller.cpp @@ -20,7 +20,7 @@ #include -Log_SetChannel(AnalogController); +LOG_CHANNEL(AnalogController); AnalogController::AnalogController(u32 index) : Controller(index) { diff --git a/src/core/analog_joystick.cpp b/src/core/analog_joystick.cpp index 5cbcc4ae7..4334a2b1e 100644 --- a/src/core/analog_joystick.cpp +++ b/src/core/analog_joystick.cpp @@ -16,7 +16,7 @@ #include "IconsPromptFont.h" #include "fmt/format.h" -Log_SetChannel(AnalogJoystick); +LOG_CHANNEL(AnalogJoystick); AnalogJoystick::AnalogJoystick(u32 index) : Controller(index) { diff --git a/src/core/bios.cpp b/src/core/bios.cpp index 44d15bcf0..f7926df68 100644 --- a/src/core/bios.cpp +++ b/src/core/bios.cpp @@ -15,7 +15,7 @@ #include "common/path.h" #include "common/string_util.h" -Log_SetChannel(BIOS); +LOG_CHANNEL(BIOS); namespace BIOS { static const ImageInfo* GetInfoForHash(const std::span image, const ImageInfo::Hash& hash); diff --git a/src/core/bus.cpp b/src/core/bus.cpp index f77be3d75..dc52d1b2b 100644 --- a/src/core/bus.cpp +++ b/src/core/bus.cpp @@ -38,7 +38,7 @@ #include #include -Log_SetChannel(Bus); +LOG_CHANNEL(Bus); // TODO: Get rid of page code bits, instead use page faults to track SMC. @@ -933,7 +933,7 @@ void Bus::AddTTYCharacter(char ch) { if (!s_tty_line_buffer.empty()) { - Log::FastWrite("TTY", "", LOGLEVEL_INFO, "\033[1;34m{}\033[0m", s_tty_line_buffer); + Log::FastWrite("TTY", "", Log::Level::Info, "\033[1;34m{}\033[0m", s_tty_line_buffer); #ifdef _DEBUG if (CPU::IsTraceEnabled()) CPU::WriteToExecutionLog("TTY: %s\n", s_tty_line_buffer.c_str()); diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index a005bfd0f..9cb19d617 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -32,7 +32,7 @@ #include #include -Log_SetChannel(CDROM); +LOG_CHANNEL(CDROM); namespace CDROM { namespace { @@ -1621,7 +1621,7 @@ void CDROM::EndCommand() void CDROM::ExecuteCommand(void*, TickCount ticks, TickCount ticks_late) { const CommandInfo& ci = s_command_info[static_cast(s_command)]; - if (Log::IsLogVisible(LOGLEVEL_DEV, ___LogChannel___)) [[unlikely]] + if (Log::IsLogVisible(Log::Level::Dev, ___LogChannel___)) [[unlikely]] { SmallString params; for (u32 i = 0; i < s_param_fifo.GetSize(); i++) diff --git a/src/core/cdrom_async_reader.cpp b/src/core/cdrom_async_reader.cpp index 5c599ffc9..7bf8e661b 100644 --- a/src/core/cdrom_async_reader.cpp +++ b/src/core/cdrom_async_reader.cpp @@ -5,7 +5,7 @@ #include "common/assert.h" #include "common/log.h" #include "common/timer.h" -Log_SetChannel(CDROMAsyncReader); +LOG_CHANNEL(CDROMAsyncReader); CDROMAsyncReader::CDROMAsyncReader() = default; diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index 91efc2385..14bda4ac5 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -18,7 +18,7 @@ #include #include -Log_SetChannel(Cheats); +LOG_CHANNEL(Cheats); static std::array cht_register; // Used for D7 ,51 & 52 cheat types diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index 961ef805b..142c23b54 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -21,7 +21,7 @@ #include "common/log.h" #include "common/memmap.h" -Log_SetChannel(CPU::CodeCache); +LOG_CHANNEL(CPU::CodeCache); // Enable dumping of recompiled block code size statistics. // #define DUMP_CODE_SIZE_STATS 1 diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index 21eff6293..dfe4853e4 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -26,7 +26,7 @@ #include -Log_SetChannel(CPU::Core); +LOG_CHANNEL(CPU::Core); namespace CPU { enum class ExecutionBreakType diff --git a/src/core/cpu_newrec_compiler.cpp b/src/core/cpu_newrec_compiler.cpp index 7da379f65..a95e9f996 100644 --- a/src/core/cpu_newrec_compiler.cpp +++ b/src/core/cpu_newrec_compiler.cpp @@ -15,7 +15,7 @@ #include #include -Log_SetChannel(NewRec::Compiler); +LOG_CHANNEL(NewRec::Compiler); // TODO: direct link skip delay slot check // TODO: speculative constants diff --git a/src/core/cpu_newrec_compiler_aarch32.cpp b/src/core/cpu_newrec_compiler_aarch32.cpp index b5ad59b83..2d9b02ca4 100644 --- a/src/core/cpu_newrec_compiler_aarch32.cpp +++ b/src/core/cpu_newrec_compiler_aarch32.cpp @@ -19,7 +19,7 @@ #ifdef CPU_ARCH_ARM32 -Log_SetChannel(CPU::NewRec); +LOG_CHANNEL(CPU::NewRec); #define PTR(x) vixl::aarch32::MemOperand(RSTATE, (((u8*)(x)) - ((u8*)&g_state))) #define RMEMBASE vixl::aarch32::r3 diff --git a/src/core/cpu_newrec_compiler_aarch64.cpp b/src/core/cpu_newrec_compiler_aarch64.cpp index 7df73e252..e0a323de2 100644 --- a/src/core/cpu_newrec_compiler_aarch64.cpp +++ b/src/core/cpu_newrec_compiler_aarch64.cpp @@ -19,7 +19,7 @@ #ifdef CPU_ARCH_ARM64 -Log_SetChannel(CPU::NewRec); +LOG_CHANNEL(CPU::NewRec); #define PTR(x) vixl::aarch64::MemOperand(RSTATE, (((u8*)(x)) - ((u8*)&g_state))) diff --git a/src/core/cpu_newrec_compiler_riscv64.cpp b/src/core/cpu_newrec_compiler_riscv64.cpp index 228fdd879..4204c893c 100644 --- a/src/core/cpu_newrec_compiler_riscv64.cpp +++ b/src/core/cpu_newrec_compiler_riscv64.cpp @@ -20,7 +20,7 @@ #ifdef CPU_ARCH_RISCV64 -Log_SetChannel(CPU::NewRec); +LOG_CHANNEL(CPU::NewRec); #ifdef ENABLE_HOST_DISASSEMBLY extern "C" { diff --git a/src/core/cpu_newrec_compiler_x64.cpp b/src/core/cpu_newrec_compiler_x64.cpp index d2357ee83..bf555ac29 100644 --- a/src/core/cpu_newrec_compiler_x64.cpp +++ b/src/core/cpu_newrec_compiler_x64.cpp @@ -20,7 +20,7 @@ #ifdef CPU_ARCH_X64 -Log_SetChannel(CPU::NewRec); +LOG_CHANNEL(CPU::NewRec); #define RMEMBASE cg->rbx #define RSTATE cg->rbp diff --git a/src/core/cpu_pgxp.cpp b/src/core/cpu_pgxp.cpp index b4b57430e..e4a3ee4d9 100644 --- a/src/core/cpu_pgxp.cpp +++ b/src/core/cpu_pgxp.cpp @@ -19,7 +19,7 @@ #include #include -Log_SetChannel(CPU::PGXP); +LOG_CHANNEL(CPU::PGXP); // #define LOG_VALUES 1 // #define LOG_LOOKUPS 1 diff --git a/src/core/cpu_recompiler_code_generator.cpp b/src/core/cpu_recompiler_code_generator.cpp index d9f456e21..40e144ce2 100644 --- a/src/core/cpu_recompiler_code_generator.cpp +++ b/src/core/cpu_recompiler_code_generator.cpp @@ -11,7 +11,7 @@ #include "common/log.h" -Log_SetChannel(CPU::Recompiler); +LOG_CHANNEL(CPU::Recompiler); // TODO: Turn load+sext/zext into a single signed/unsigned load // TODO: mulx/shlx/etc diff --git a/src/core/cpu_recompiler_code_generator_aarch32.cpp b/src/core/cpu_recompiler_code_generator_aarch32.cpp index 43a73a3cb..6b67bb4f1 100644 --- a/src/core/cpu_recompiler_code_generator_aarch32.cpp +++ b/src/core/cpu_recompiler_code_generator_aarch32.cpp @@ -16,7 +16,7 @@ #ifdef CPU_ARCH_ARM32 -Log_SetChannel(CPU::Recompiler); +LOG_CHANNEL(CPU::Recompiler); #ifdef ENABLE_HOST_DISASSEMBLY #include "vixl/aarch32/disasm-aarch32.h" diff --git a/src/core/cpu_recompiler_code_generator_aarch64.cpp b/src/core/cpu_recompiler_code_generator_aarch64.cpp index 825da398e..df6ae270b 100644 --- a/src/core/cpu_recompiler_code_generator_aarch64.cpp +++ b/src/core/cpu_recompiler_code_generator_aarch64.cpp @@ -16,7 +16,7 @@ #ifdef CPU_ARCH_ARM64 -Log_SetChannel(CPU::Recompiler); +LOG_CHANNEL(CPU::Recompiler); #ifdef ENABLE_HOST_DISASSEMBLY #include "vixl/aarch64/disasm-aarch64.h" diff --git a/src/core/cpu_recompiler_code_generator_generic.cpp b/src/core/cpu_recompiler_code_generator_generic.cpp index c8b229275..97e3b3414 100644 --- a/src/core/cpu_recompiler_code_generator_generic.cpp +++ b/src/core/cpu_recompiler_code_generator_generic.cpp @@ -8,7 +8,7 @@ #include "common/log.h" -Log_SetChannel(Recompiler::CodeGenerator); +LOG_CHANNEL(Recompiler::CodeGenerator); namespace CPU::Recompiler { diff --git a/src/core/cpu_recompiler_code_generator_x64.cpp b/src/core/cpu_recompiler_code_generator_x64.cpp index 115a35ecc..bb4160639 100644 --- a/src/core/cpu_recompiler_code_generator_x64.cpp +++ b/src/core/cpu_recompiler_code_generator_x64.cpp @@ -16,7 +16,7 @@ #ifdef CPU_ARCH_X64 -Log_SetChannel(Recompiler::CodeGenerator); +LOG_CHANNEL(Recompiler::CodeGenerator); #ifdef ENABLE_HOST_DISASSEMBLY #include "Zycore/Format.h" @@ -260,7 +260,7 @@ void CPU::CodeCache::DisassembleAndLogHostCode(const void* start, u32 size) else hex.append(" "); } - Log::FastWrite("HostCode", "", LOGLEVEL_DEBUG, " {:016X} {} {}", + Log::FastWrite("HostCode", "", Log::Level::Debug, " {:016X} {} {}", static_cast(reinterpret_cast(ptr)), hex, buffer); } diff --git a/src/core/cpu_recompiler_register_cache.cpp b/src/core/cpu_recompiler_register_cache.cpp index 3c29226b1..0efbd4496 100644 --- a/src/core/cpu_recompiler_register_cache.cpp +++ b/src/core/cpu_recompiler_register_cache.cpp @@ -8,7 +8,7 @@ #include -Log_SetChannel(CPU::Recompiler); +LOG_CHANNEL(CPU::Recompiler); namespace CPU::Recompiler { diff --git a/src/core/dma.cpp b/src/core/dma.cpp index 5a4a11902..d1cf5c13c 100644 --- a/src/core/dma.cpp +++ b/src/core/dma.cpp @@ -26,7 +26,7 @@ #include #include -Log_SetChannel(DMA); +LOG_CHANNEL(DMA); namespace DMA { namespace { diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index dc7866a04..65922c212 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -42,7 +42,7 @@ #include #include -Log_SetChannel(FullscreenUI); +LOG_CHANNEL(FullscreenUI); #define TR_CONTEXT "FullscreenUI" @@ -5128,7 +5128,7 @@ void FullscreenUI::DrawAdvancedSettingsPage() DrawEnumSetting(bsi, FSUI_CSTR("Log Level"), FSUI_CSTR("Sets the verbosity of messages logged. Higher levels will log more messages."), "Logging", "LogLevel", Settings::DEFAULT_LOG_LEVEL, &Settings::ParseLogLevelName, &Settings::GetLogLevelName, - &Settings::GetLogLevelDisplayName, LOGLEVEL_COUNT); + &Settings::GetLogLevelDisplayName, Log::Level::Count); DrawToggleSetting(bsi, FSUI_CSTR("Log To System Console"), FSUI_CSTR("Logs messages to the console window."), FSUI_CSTR("Logging"), "LogToConsole", false); DrawToggleSetting(bsi, FSUI_CSTR("Log To Debug Console"), diff --git a/src/core/game_database.cpp b/src/core/game_database.cpp index e539ff39c..22fb040cf 100644 --- a/src/core/game_database.cpp +++ b/src/core/game_database.cpp @@ -31,7 +31,7 @@ #include "IconsFontAwesome5.h" #include "fmt/format.h" -Log_SetChannel(GameDatabase); +LOG_CHANNEL(GameDatabase); #include "common/ryml_helpers.h" diff --git a/src/core/game_list.cpp b/src/core/game_list.cpp index caeffc88b..0b22c9f72 100644 --- a/src/core/game_list.cpp +++ b/src/core/game_list.cpp @@ -35,7 +35,7 @@ #include #include -Log_SetChannel(GameList); +LOG_CHANNEL(GameList); #ifdef _WIN32 #include "common/windows_headers.h" diff --git a/src/core/gdb_server.cpp b/src/core/gdb_server.cpp index b9c561d93..84c52c16b 100644 --- a/src/core/gdb_server.cpp +++ b/src/core/gdb_server.cpp @@ -21,7 +21,7 @@ #include #include -Log_SetChannel(GDBProtocol); +LOG_CHANNEL(GDBProtocol); namespace GDBProtocol { static bool IsPacketInterrupt(std::string_view data); diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index a385b7be3..64d7d0853 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -35,7 +35,7 @@ #include #include -Log_SetChannel(GPU); +LOG_CHANNEL(GPU); std::unique_ptr g_gpu; alignas(HOST_PAGE_SIZE) u16 g_vram[VRAM_SIZE / sizeof(u16)]; diff --git a/src/core/gpu_backend.cpp b/src/core/gpu_backend.cpp index a27b7591f..dc841bdde 100644 --- a/src/core/gpu_backend.cpp +++ b/src/core/gpu_backend.cpp @@ -10,7 +10,7 @@ #include "common/log.h" #include "common/timer.h" -Log_SetChannel(GPUBackend); +LOG_CHANNEL(GPUBackend); std::unique_ptr g_gpu_backend; diff --git a/src/core/gpu_commands.cpp b/src/core/gpu_commands.cpp index 6bc3effee..60f97a15b 100644 --- a/src/core/gpu_commands.cpp +++ b/src/core/gpu_commands.cpp @@ -10,7 +10,7 @@ #include "common/log.h" #include "common/string_util.h" -Log_SetChannel(GPU); +LOG_CHANNEL(GPU); #define CHECK_COMMAND_SIZE(num_words) \ if (m_fifo.GetSize() < num_words) \ diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index c1d806508..9c420c02d 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -32,7 +32,7 @@ #include #include -Log_SetChannel(GPU_HW); +LOG_CHANNEL(GPU_HW); // TODO: instead of full state restore, only restore what changed diff --git a/src/core/gpu_sw.cpp b/src/core/gpu_sw.cpp index f9ba57035..95cef32d5 100644 --- a/src/core/gpu_sw.cpp +++ b/src/core/gpu_sw.cpp @@ -14,7 +14,7 @@ #include -Log_SetChannel(GPU_SW); +LOG_CHANNEL(GPU_SW); GPU_SW::GPU_SW() = default; diff --git a/src/core/gpu_sw_rasterizer.cpp b/src/core/gpu_sw_rasterizer.cpp index b7dc3eabc..816cf3076 100644 --- a/src/core/gpu_sw_rasterizer.cpp +++ b/src/core/gpu_sw_rasterizer.cpp @@ -9,7 +9,7 @@ #include "common/log.h" #include "common/string_util.h" -Log_SetChannel(GPU_SW_Rasterizer); +LOG_CHANNEL(GPU_SW_Rasterizer); namespace GPU_SW_Rasterizer { // Default implementation, compatible with all ISAs. diff --git a/src/core/guncon.cpp b/src/core/guncon.cpp index 372908064..e2f0c8fc7 100644 --- a/src/core/guncon.cpp +++ b/src/core/guncon.cpp @@ -20,7 +20,7 @@ #ifdef _DEBUG #include "common/log.h" -Log_SetChannel(GunCon); +LOG_CHANNEL(GunCon); #endif static constexpr std::array(GunCon::Binding::ButtonCount)> s_button_indices = {{13, 3, 14}}; diff --git a/src/core/host.cpp b/src/core/host.cpp index 8e861fbca..06e8d6890 100644 --- a/src/core/host.cpp +++ b/src/core/host.cpp @@ -27,7 +27,7 @@ #include #include -Log_SetChannel(Host); +LOG_CHANNEL(Host); namespace Host { static std::mutex s_settings_mutex; diff --git a/src/core/host_interface_progress_callback.cpp b/src/core/host_interface_progress_callback.cpp index 3f31991f1..05d348d8c 100644 --- a/src/core/host_interface_progress_callback.cpp +++ b/src/core/host_interface_progress_callback.cpp @@ -6,7 +6,7 @@ #include "common/log.h" -Log_SetChannel(HostInterfaceProgressCallback); +LOG_CHANNEL(HostInterfaceProgressCallback); HostInterfaceProgressCallback::HostInterfaceProgressCallback() : ProgressCallback() { diff --git a/src/core/imgui_overlays.cpp b/src/core/imgui_overlays.cpp index 08497c6d5..5846aac7b 100644 --- a/src/core/imgui_overlays.cpp +++ b/src/core/imgui_overlays.cpp @@ -44,7 +44,7 @@ #include #include -Log_SetChannel(ImGuiManager); +LOG_CHANNEL(ImGuiManager); namespace ImGuiManager { static void FormatProcessorStat(SmallStringBase& text, double usage, double time); diff --git a/src/core/interrupt_controller.cpp b/src/core/interrupt_controller.cpp index a082b3b91..592497e4f 100644 --- a/src/core/interrupt_controller.cpp +++ b/src/core/interrupt_controller.cpp @@ -8,7 +8,7 @@ #include "common/log.h" -Log_SetChannel(InterruptController); +LOG_CHANNEL(InterruptController); namespace InterruptController { diff --git a/src/core/justifier.cpp b/src/core/justifier.cpp index 94c0264c6..4d0c66070 100644 --- a/src/core/justifier.cpp +++ b/src/core/justifier.cpp @@ -19,7 +19,7 @@ #include "IconsPromptFont.h" #include -Log_SetChannel(Justifier); +LOG_CHANNEL(Justifier); // #define CHECK_TIMING 1 #ifdef CHECK_TIMING diff --git a/src/core/mdec.cpp b/src/core/mdec.cpp index dd3654fee..6f27b78b5 100644 --- a/src/core/mdec.cpp +++ b/src/core/mdec.cpp @@ -20,7 +20,7 @@ #include #include -Log_SetChannel(MDEC); +LOG_CHANNEL(MDEC); namespace MDEC { namespace { diff --git a/src/core/memory_card.cpp b/src/core/memory_card.cpp index 648d65daf..f7062fde8 100644 --- a/src/core/memory_card.cpp +++ b/src/core/memory_card.cpp @@ -18,7 +18,7 @@ #include "IconsFontAwesome5.h" #include "fmt/format.h" -Log_SetChannel(MemoryCard); +LOG_CHANNEL(MemoryCard); MemoryCard::MemoryCard() : m_save_event( diff --git a/src/core/memory_card_image.cpp b/src/core/memory_card_image.cpp index 39653dc95..fdba23ca0 100644 --- a/src/core/memory_card_image.cpp +++ b/src/core/memory_card_image.cpp @@ -19,7 +19,7 @@ #include #include -Log_SetChannel(MemoryCard); +LOG_CHANNEL(MemoryCard); namespace MemoryCardImage { namespace { diff --git a/src/core/multitap.cpp b/src/core/multitap.cpp index 7b604a832..1f1a541ae 100644 --- a/src/core/multitap.cpp +++ b/src/core/multitap.cpp @@ -11,7 +11,7 @@ #include "common/log.h" #include "common/types.h" -Log_SetChannel(Multitap); +LOG_CHANNEL(Multitap); Multitap::Multitap() { diff --git a/src/core/negcon_rumble.cpp b/src/core/negcon_rumble.cpp index 0f17526e3..2806133c2 100644 --- a/src/core/negcon_rumble.cpp +++ b/src/core/negcon_rumble.cpp @@ -23,7 +23,7 @@ #include -Log_SetChannel(NeGconRumble); +LOG_CHANNEL(NeGconRumble); // Mapping of Button to index of corresponding bit in m_button_state static constexpr std::array(NeGconRumble::Button::Count)> s_button_indices = {3, 4, 5, 6, diff --git a/src/core/pad.cpp b/src/core/pad.cpp index 2d10c0b4d..ad9fa869d 100644 --- a/src/core/pad.cpp +++ b/src/core/pad.cpp @@ -26,7 +26,7 @@ #include #include -Log_SetChannel(Pad); +LOG_CHANNEL(Pad); namespace Pad { diff --git a/src/core/pcdrv.cpp b/src/core/pcdrv.cpp index 32d57b952..c24ad9216 100644 --- a/src/core/pcdrv.cpp +++ b/src/core/pcdrv.cpp @@ -10,7 +10,7 @@ #include "common/path.h" #include "common/string_util.h" -Log_SetChannel(PCDrv); +LOG_CHANNEL(PCDrv); static constexpr u32 MAX_FILES = 100; diff --git a/src/core/playstation_mouse.cpp b/src/core/playstation_mouse.cpp index f41443fce..d6b1f3a87 100644 --- a/src/core/playstation_mouse.cpp +++ b/src/core/playstation_mouse.cpp @@ -16,7 +16,7 @@ #include #include -Log_SetChannel(PlayStationMouse); +LOG_CHANNEL(PlayStationMouse); static constexpr std::array(PlayStationMouse::Binding::ButtonCount)> s_button_indices = { {11, 10}}; diff --git a/src/core/psf_loader.cpp b/src/core/psf_loader.cpp index 451cd0024..fca857322 100644 --- a/src/core/psf_loader.cpp +++ b/src/core/psf_loader.cpp @@ -15,7 +15,7 @@ #include -Log_SetChannel(PSFLoader); +LOG_CHANNEL(PSFLoader); namespace PSFLoader { static bool LoadLibraryPSF(const std::string& path, bool use_pc_sp, Error* error, u32 depth = 0); diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 0d5df41a6..08f402654 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -25,7 +25,7 @@ #include #include -Log_SetChannel(Settings); +LOG_CHANNEL(Settings); Settings g_settings; @@ -906,13 +906,13 @@ static constexpr const std::array s_log_level_display_names = { TRANSLATE_DISAMBIG_NOOP("Settings", "Trace", "LogLevel"), }; -std::optional Settings::ParseLogLevelName(const char* str) +std::optional Settings::ParseLogLevelName(const char* str) { int index = 0; for (const char* name : s_log_level_names) { if (StringUtil::Strcasecmp(name, str) == 0) - return static_cast(index); + return static_cast(index); index++; } @@ -920,12 +920,12 @@ std::optional Settings::ParseLogLevelName(const char* str) return std::nullopt; } -const char* Settings::GetLogLevelName(LOGLEVEL level) +const char* Settings::GetLogLevelName(Log::Level level) { return s_log_level_names[static_cast(level)]; } -const char* Settings::GetLogLevelDisplayName(LOGLEVEL level) +const char* Settings::GetLogLevelDisplayName(Log::Level level) { return Host::TranslateToCString("Settings", s_log_level_display_names[static_cast(level)], "LogLevel"); } diff --git a/src/core/settings.h b/src/core/settings.h index a6dd7d055..3cda6718e 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -270,7 +270,7 @@ struct Settings std::string pcdrv_root; bool pcdrv_enable_writes = false; - LOGLEVEL log_level = DEFAULT_LOG_LEVEL; + Log::Level log_level = DEFAULT_LOG_LEVEL; std::string log_filter; bool log_timestamps : 1 = true; bool log_to_console : 1 = false; @@ -361,9 +361,9 @@ struct Settings static void SetDefaultControllerConfig(SettingsInterface& si); static void SetDefaultHotkeyConfig(SettingsInterface& si); - static std::optional ParseLogLevelName(const char* str); - static const char* GetLogLevelName(LOGLEVEL level); - static const char* GetLogLevelDisplayName(LOGLEVEL level); + static std::optional ParseLogLevelName(const char* str); + static const char* GetLogLevelName(Log::Level level); + static const char* GetLogLevelDisplayName(Log::Level level); static std::span GetLogFilters(); static std::optional ParseConsoleRegionName(const char* str); @@ -512,7 +512,7 @@ struct Settings static constexpr s32 DEFAULT_ACHIEVEMENT_NOTIFICATION_TIME = 5; static constexpr s32 DEFAULT_LEADERBOARD_NOTIFICATION_TIME = 10; - static constexpr LOGLEVEL DEFAULT_LOG_LEVEL = LOGLEVEL_INFO; + static constexpr Log::Level DEFAULT_LOG_LEVEL = Log::Level::Info; static constexpr SaveStateCompressionMode DEFAULT_SAVE_STATE_COMPRESSION_MODE = SaveStateCompressionMode::ZstDefault; diff --git a/src/core/sio.cpp b/src/core/sio.cpp index b7f600ef7..fb1b1ad87 100644 --- a/src/core/sio.cpp +++ b/src/core/sio.cpp @@ -13,7 +13,7 @@ #include #include -Log_SetChannel(SIO); +LOG_CHANNEL(SIO); namespace SIO { namespace { diff --git a/src/core/spu.cpp b/src/core/spu.cpp index ace287aa3..eb5e17aae 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -27,7 +27,7 @@ #include -Log_SetChannel(SPU); +LOG_CHANNEL(SPU); // Enable to dump all voices of the SPU audio individually. // #define SPU_DUMP_ALL_VOICES 1 diff --git a/src/core/system.cpp b/src/core/system.cpp index f03279046..a3e238584 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -80,7 +80,7 @@ #include #include -Log_SetChannel(System); +LOG_CHANNEL(System); #ifdef _WIN32 #include "common/windows_headers.h" diff --git a/src/core/texture_replacements.cpp b/src/core/texture_replacements.cpp index 03f6dc566..8b518e749 100644 --- a/src/core/texture_replacements.cpp +++ b/src/core/texture_replacements.cpp @@ -25,7 +25,7 @@ #include #include -Log_SetChannel(TextureReplacements); +LOG_CHANNEL(TextureReplacements); namespace TextureReplacements { namespace { diff --git a/src/core/timers.cpp b/src/core/timers.cpp index a08a84719..b7792daba 100644 --- a/src/core/timers.cpp +++ b/src/core/timers.cpp @@ -17,7 +17,7 @@ #include #include -Log_SetChannel(Timers); +LOG_CHANNEL(Timers); namespace Timers { namespace { diff --git a/src/core/timing_event.cpp b/src/core/timing_event.cpp index c5e826145..e0882726a 100644 --- a/src/core/timing_event.cpp +++ b/src/core/timing_event.cpp @@ -12,7 +12,7 @@ #include "common/log.h" #include "common/thirdparty/SmallVector.h" -Log_SetChannel(TimingEvents); +LOG_CHANNEL(TimingEvents); namespace TimingEvents { diff --git a/src/duckstation-qt/advancedsettingswidget.cpp b/src/duckstation-qt/advancedsettingswidget.cpp index 106e478b2..c9af71ca3 100644 --- a/src/duckstation-qt/advancedsettingswidget.cpp +++ b/src/duckstation-qt/advancedsettingswidget.cpp @@ -162,8 +162,8 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget* m_ui.setupUi(this); - for (u32 i = 0; i < static_cast(LOGLEVEL_COUNT); i++) - m_ui.logLevel->addItem(QString::fromUtf8(Settings::GetLogLevelDisplayName(static_cast(i)))); + for (u32 i = 0; i < static_cast(Log::Level::Count); i++) + m_ui.logLevel->addItem(QString::fromUtf8(Settings::GetLogLevelDisplayName(static_cast(i)))); SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.logLevel, "Logging", "LogLevel", &Settings::ParseLogLevelName, &Settings::GetLogLevelName, Settings::DEFAULT_LOG_LEVEL); @@ -298,13 +298,13 @@ void AdvancedSettingsWidget::onResetToDefaultClicked() setChoiceTweakOption(m_ui.tweakOptionTable, i++, Settings::DEFAULT_CPU_FASTMEM_MODE); // Recompiler fastmem mode setChoiceTweakOption(m_ui.tweakOptionTable, i++, - Settings::DEFAULT_CDROM_MECHACON_VERSION); // CDROM Mechacon Version - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // CDROM Region Check - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Allow booting without SBI file - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Export Shared Memory - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV Writes - setDirectoryOption(m_ui.tweakOptionTable, i++, ""); // PCDrv Root Directory + Settings::DEFAULT_CDROM_MECHACON_VERSION); // CDROM Mechacon Version + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // CDROM Region Check + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Allow booting without SBI file + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Export Shared Memory + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV Writes + setDirectoryOption(m_ui.tweakOptionTable, i++, ""); // PCDrv Root Directory return; } diff --git a/src/duckstation-qt/autoupdaterdialog.cpp b/src/duckstation-qt/autoupdaterdialog.cpp index 70a887180..99c7dff7b 100644 --- a/src/duckstation-qt/autoupdaterdialog.cpp +++ b/src/duckstation-qt/autoupdaterdialog.cpp @@ -66,7 +66,7 @@ static const char* THIS_RELEASE_TAG = SCM_RELEASE_TAG; #endif -Log_SetChannel(AutoUpdaterDialog); +LOG_CHANNEL(AutoUpdaterDialog); AutoUpdaterDialog::AutoUpdaterDialog(QWidget* parent /* = nullptr */) : QDialog(parent) { diff --git a/src/duckstation-qt/controllerbindingwidgets.cpp b/src/duckstation-qt/controllerbindingwidgets.cpp index c2258127c..8122e9be4 100644 --- a/src/duckstation-qt/controllerbindingwidgets.cpp +++ b/src/duckstation-qt/controllerbindingwidgets.cpp @@ -38,7 +38,7 @@ #include #include -Log_SetChannel(ControllerBindingWidget); +LOG_CHANNEL(ControllerBindingWidget); ControllerBindingWidget::ControllerBindingWidget(QWidget* parent, ControllerSettingsWindow* dialog, u32 port) : QWidget(parent), m_dialog(dialog), m_config_section(Controller::GetSettingsSection(port)), m_port_number(port) diff --git a/src/duckstation-qt/displaywidget.cpp b/src/duckstation-qt/displaywidget.cpp index c300e3da1..a4bd46bd8 100644 --- a/src/duckstation-qt/displaywidget.cpp +++ b/src/duckstation-qt/displaywidget.cpp @@ -30,7 +30,7 @@ #include "common/windows_headers.h" #endif -Log_SetChannel(DisplayWidget); +LOG_CHANNEL(DisplayWidget); DisplayWidget::DisplayWidget(QWidget* parent) : QWidget(parent) { diff --git a/src/duckstation-qt/logwindow.cpp b/src/duckstation-qt/logwindow.cpp index 3ee828005..cc48b8148 100644 --- a/src/duckstation-qt/logwindow.cpp +++ b/src/duckstation-qt/logwindow.cpp @@ -157,11 +157,11 @@ void LogWindow::createUi() settings_menu->addSeparator(); m_level_menu = settings_menu->addMenu(tr("&Log Level")); - for (u32 i = 0; i < static_cast(LOGLEVEL_COUNT); i++) + for (u32 i = 0; i < static_cast(Log::Level::Count); i++) { - action = m_level_menu->addAction(QString::fromUtf8(Settings::GetLogLevelDisplayName(static_cast(i)))); + action = m_level_menu->addAction(QString::fromUtf8(Settings::GetLogLevelDisplayName(static_cast(i)))); action->setCheckable(true); - connect(action, &QAction::triggered, this, [this, i]() { setLogLevel(static_cast(i)); }); + connect(action, &QAction::triggered, this, [this, i]() { setLogLevel(static_cast(i)); }); } updateLogLevelUi(); @@ -191,15 +191,16 @@ void LogWindow::createUi() void LogWindow::updateLogLevelUi() { - const u32 level = Settings::ParseLogLevelName(Host::GetBaseStringSettingValue("Logging", "LogLevel", "").c_str()) - .value_or(Settings::DEFAULT_LOG_LEVEL); + const Log::Level level = + Settings::ParseLogLevelName(Host::GetBaseStringSettingValue("Logging", "LogLevel", "").c_str()) + .value_or(Settings::DEFAULT_LOG_LEVEL); const QList actions = m_level_menu->actions(); for (u32 i = 0; i < actions.size(); i++) - actions[i]->setChecked(i == level); + actions[i]->setChecked(static_cast(i) == level); } -void LogWindow::setLogLevel(LOGLEVEL level) +void LogWindow::setLogLevel(Log::Level level) { Host::SetBaseStringSettingValue("Logging", "LogLevel", Settings::GetLogLevelName(level)); Host::CommitBaseSettingChanges(); @@ -273,10 +274,11 @@ void LogWindow::onSaveTriggered() file.write(m_text->toPlainText().toUtf8()); file.close(); - appendMessage(QLatin1StringView("LogWindow"), LOGLEVEL_INFO, tr("Log was written to %1.\n").arg(path)); + appendMessage(QLatin1StringView("LogWindow"), static_cast(Log::Level::Info), + tr("Log was written to %1.\n").arg(path)); } -void LogWindow::logCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, +void LogWindow::logCallback(void* pUserParam, const char* channelName, const char* functionName, Log::Level level, std::string_view message) { LogWindow* this_ptr = static_cast(pUserParam); @@ -289,11 +291,11 @@ void LogWindow::logCallback(void* pUserParam, const char* channelName, const cha qmessage.append(QUtf8StringView(message.data(), message.length())); qmessage.append(QChar('\n')); - const QLatin1StringView qchannel((level <= LOGLEVEL_WARNING) ? functionName : channelName); + const QLatin1StringView qchannel((level <= Log::Level::Warning) ? functionName : channelName); if (g_emu_thread->isOnUIThread()) { - this_ptr->appendMessage(qchannel, level, qmessage); + this_ptr->appendMessage(qchannel, static_cast(level), qmessage); } else { @@ -328,8 +330,9 @@ void LogWindow::appendMessage(const QLatin1StringView& channel, quint32 level, c temp_cursor.movePosition(QTextCursor::End); { - static constexpr const QChar level_characters[LOGLEVEL_COUNT] = {'X', 'E', 'W', 'I', 'V', 'D', 'B', 'T'}; - static constexpr const QColor level_colors[LOGLEVEL_COUNT] = { + static constexpr const QChar level_characters[static_cast(Log::Level::Count)] = {'X', 'E', 'W', 'I', + 'V', 'D', 'B', 'T'}; + static constexpr const QColor level_colors[static_cast(Log::Level::Count)] = { QColor(255, 255, 255), // NONE QColor(0xE7, 0x48, 0x56), // ERROR, Red Intensity QColor(0xF9, 0xF1, 0xA5), // WARNING, Yellow Intensity @@ -353,7 +356,7 @@ void LogWindow::appendMessage(const QLatin1StringView& channel, quint32 level, c temp_cursor.insertText(qtimestamp); } - const QString qchannel = (level <= LOGLEVEL_WARNING) ? + const QString qchannel = (level <= static_cast(Log::Level::Warning)) ? QStringLiteral("%1(%2): ").arg(level_characters[level]).arg(channel) : QStringLiteral("%1/%2: ").arg(level_characters[level]).arg(channel); format.setForeground(QBrush(channel_color)); diff --git a/src/duckstation-qt/logwindow.h b/src/duckstation-qt/logwindow.h index bf14dd56f..564d4d2e3 100644 --- a/src/duckstation-qt/logwindow.h +++ b/src/duckstation-qt/logwindow.h @@ -28,11 +28,11 @@ public: private: void createUi(); void updateLogLevelUi(); - void setLogLevel(LOGLEVEL level); + void setLogLevel(Log::Level level); void populateFilters(QMenu* filter_menu); void setChannelFiltered(size_t index, bool state); - static void logCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, + static void logCallback(void* pUserParam, const char* channelName, const char* functionName, Log::Level level, std::string_view message); protected: diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index bb2239ae3..009af178d 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -58,7 +58,7 @@ #include #endif -Log_SetChannel(MainWindow); +LOG_CHANNEL(MainWindow); static constexpr char DISC_IMAGE_FILTER[] = QT_TRANSLATE_NOOP( "MainWindow", diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index 3f94d678d..04e1632f9 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -66,7 +66,7 @@ #include #include -Log_SetChannel(QtHost); +LOG_CHANNEL(QtHost); #ifdef _WIN32 #include "common/windows_headers.h" diff --git a/src/duckstation-qt/qttranslations.cpp b/src/duckstation-qt/qttranslations.cpp index 40d2a11c8..8bba4f646 100644 --- a/src/duckstation-qt/qttranslations.cpp +++ b/src/duckstation-qt/qttranslations.cpp @@ -32,7 +32,7 @@ #include #endif -Log_SetChannel(QTTranslations); +LOG_CHANNEL(QTTranslations); #if 0 // Qt internal strings we'd like to have translated diff --git a/src/duckstation-qt/qtutils.cpp b/src/duckstation-qt/qtutils.cpp index a6218013b..f71161ea6 100644 --- a/src/duckstation-qt/qtutils.cpp +++ b/src/duckstation-qt/qtutils.cpp @@ -39,7 +39,7 @@ #include "common/windows_headers.h" #endif -Log_SetChannel(QtUtils); +LOG_CHANNEL(QtUtils); QFrame* QtUtils::CreateHorizontalLine(QWidget* parent) { diff --git a/src/duckstation-qt/settingswindow.cpp b/src/duckstation-qt/settingswindow.cpp index 16c152c44..6eac9f183 100644 --- a/src/duckstation-qt/settingswindow.cpp +++ b/src/duckstation-qt/settingswindow.cpp @@ -34,7 +34,7 @@ #include #include -Log_SetChannel(SettingsWindow); +LOG_CHANNEL(SettingsWindow); static QList s_open_game_properties_dialogs; diff --git a/src/duckstation-regtest/regtest_host.cpp b/src/duckstation-regtest/regtest_host.cpp index 17f5f4d44..d16204474 100644 --- a/src/duckstation-regtest/regtest_host.cpp +++ b/src/duckstation-regtest/regtest_host.cpp @@ -33,7 +33,7 @@ #include #include -Log_SetChannel(RegTestHost); +LOG_CHANNEL(RegTestHost); namespace RegTestHost { static bool ParseCommandLineParameters(int argc, char* argv[], std::optional& autoboot); @@ -109,7 +109,7 @@ bool RegTestHost::InitializeConfig() si.SetStringValue("Audio", "Backend", AudioStream::GetBackendName(AudioBackend::Null)); si.SetBoolValue("Logging", "LogToConsole", false); si.SetBoolValue("Logging", "LogToFile", false); - si.SetStringValue("Logging", "LogLevel", Settings::GetLogLevelName(LOGLEVEL_INFO)); + si.SetStringValue("Logging", "LogLevel", Settings::GetLogLevelName(Log::Level::Info)); si.SetBoolValue("Main", "ApplyGameSettings", false); // don't want game settings interfering si.SetBoolValue("BIOS", "PatchFastBoot", true); // no point validating the bios intro.. si.SetFloatValue("Main", "EmulationSpeed", 0.0f); @@ -585,7 +585,7 @@ bool RegTestHost::ParseCommandLineParameters(int argc, char* argv[], std::option } else if (CHECK_ARG_PARAM("-log")) { - std::optional level = Settings::ParseLogLevelName(argv[++i]); + std::optional level = Settings::ParseLogLevelName(argv[++i]); if (!level.has_value()) { ERROR_LOG("Invalid log level specified."); @@ -715,7 +715,7 @@ bool RegTestHost::SetNewDataRoot(const std::string& filename) EmuFolders::DataRoot = std::move(dump_directory); s_base_settings_interface->SetBoolValue("Logging", "LogToConsole", false); s_base_settings_interface->SetBoolValue("Logging", "LogToFile", true); - s_base_settings_interface->SetStringValue("Logging", "LogLevel", Settings::GetLogLevelName(LOGLEVEL_DEV)); + s_base_settings_interface->SetStringValue("Logging", "LogLevel", Settings::GetLogLevelName(Log::Level::Dev)); System::ApplySettings(false); } diff --git a/src/updater/cocoa_progress_callback.mm b/src/updater/cocoa_progress_callback.mm index dadb3d248..ac2e61370 100644 --- a/src/updater/cocoa_progress_callback.mm +++ b/src/updater/cocoa_progress_callback.mm @@ -6,7 +6,7 @@ #include "common/cocoa_tools.h" #include "common/log.h" -Log_SetChannel(CocoaProgressCallback); +LOG_CHANNEL(CocoaProgressCallback); CocoaProgressCallback::CocoaProgressCallback() : ProgressCallback() { diff --git a/src/updater/win32_progress_callback.cpp b/src/updater/win32_progress_callback.cpp index 6bcf7d10d..e046b090d 100644 --- a/src/updater/win32_progress_callback.cpp +++ b/src/updater/win32_progress_callback.cpp @@ -8,7 +8,7 @@ #include -Log_SetChannel(Win32ProgressCallback); +LOG_CHANNEL(Win32ProgressCallback); Win32ProgressCallback::Win32ProgressCallback() : ProgressCallback() { diff --git a/src/util/audio_stream.cpp b/src/util/audio_stream.cpp index 513f18216..3f8b83443 100644 --- a/src/util/audio_stream.cpp +++ b/src/util/audio_stream.cpp @@ -20,7 +20,7 @@ #include #include -Log_SetChannel(AudioStream); +LOG_CHANNEL(AudioStream); static constexpr bool LOG_TIMESTRETCH_STATS = false; diff --git a/src/util/cd_image.cpp b/src/util/cd_image.cpp index 043bfe703..b8527ba63 100644 --- a/src/util/cd_image.cpp +++ b/src/util/cd_image.cpp @@ -13,7 +13,7 @@ #include -Log_SetChannel(CDImage); +LOG_CHANNEL(CDImage); CDImage::CDImage() = default; diff --git a/src/util/cd_image_chd.cpp b/src/util/cd_image_chd.cpp index f6018d03a..0229cc0a8 100644 --- a/src/util/cd_image_chd.cpp +++ b/src/util/cd_image_chd.cpp @@ -27,7 +27,7 @@ #include #include -Log_SetChannel(CDImageCHD); +LOG_CHANNEL(CDImageCHD); namespace { diff --git a/src/util/cd_image_cue.cpp b/src/util/cd_image_cue.cpp index 766dfeb47..ad12da262 100644 --- a/src/util/cd_image_cue.cpp +++ b/src/util/cd_image_cue.cpp @@ -17,7 +17,7 @@ #include #include -Log_SetChannel(CDImageCueSheet); +LOG_CHANNEL(CDImageCueSheet); namespace { diff --git a/src/util/cd_image_device.cpp b/src/util/cd_image_device.cpp index 7e73b688d..c16ce060e 100644 --- a/src/util/cd_image_device.cpp +++ b/src/util/cd_image_device.cpp @@ -23,7 +23,7 @@ #include #include -Log_SetChannel(CDImageDevice); +LOG_CHANNEL(CDImageDevice); // Common code [[maybe_unused]] static constexpr u32 MAX_TRACK_NUMBER = 99; diff --git a/src/util/cd_image_ecm.cpp b/src/util/cd_image_ecm.cpp index dd1a6b69c..c4f8c8480 100644 --- a/src/util/cd_image_ecm.cpp +++ b/src/util/cd_image_ecm.cpp @@ -15,7 +15,7 @@ #include #include -Log_SetChannel(CDImageEcm); +LOG_CHANNEL(CDImageEcm); namespace { diff --git a/src/util/cd_image_m3u.cpp b/src/util/cd_image_m3u.cpp index ff59b109e..12f79219d 100644 --- a/src/util/cd_image_m3u.cpp +++ b/src/util/cd_image_m3u.cpp @@ -15,7 +15,7 @@ #include #include -Log_SetChannel(CDImageMemory); +LOG_CHANNEL(CDImageMemory); namespace { diff --git a/src/util/cd_image_mds.cpp b/src/util/cd_image_mds.cpp index a190d41fa..34d4d9367 100644 --- a/src/util/cd_image_mds.cpp +++ b/src/util/cd_image_mds.cpp @@ -14,7 +14,7 @@ #include #include -Log_SetChannel(CDImageMds); +LOG_CHANNEL(CDImageMds); namespace { diff --git a/src/util/cd_image_memory.cpp b/src/util/cd_image_memory.cpp index 6532ae6bf..847e446b5 100644 --- a/src/util/cd_image_memory.cpp +++ b/src/util/cd_image_memory.cpp @@ -12,7 +12,7 @@ #include #include -Log_SetChannel(CDImageMemory); +LOG_CHANNEL(CDImageMemory); namespace { diff --git a/src/util/cd_image_pbp.cpp b/src/util/cd_image_pbp.cpp index f893422b4..7220ee6b5 100644 --- a/src/util/cd_image_pbp.cpp +++ b/src/util/cd_image_pbp.cpp @@ -22,7 +22,7 @@ #include #include -Log_SetChannel(CDImagePBP); +LOG_CHANNEL(CDImagePBP); namespace { diff --git a/src/util/cd_image_ppf.cpp b/src/util/cd_image_ppf.cpp index a929fcdd1..22ea204da 100644 --- a/src/util/cd_image_ppf.cpp +++ b/src/util/cd_image_ppf.cpp @@ -14,7 +14,7 @@ #include #include -Log_SetChannel(CDImagePPF); +LOG_CHANNEL(CDImagePPF); namespace { diff --git a/src/util/cd_subchannel_replacement.cpp b/src/util/cd_subchannel_replacement.cpp index 449637b04..c24fabfaa 100644 --- a/src/util/cd_subchannel_replacement.cpp +++ b/src/util/cd_subchannel_replacement.cpp @@ -7,7 +7,7 @@ #include "common/path.h" #include #include -Log_SetChannel(CDSubChannelReplacement); +LOG_CHANNEL(CDSubChannelReplacement); #pragma pack(push, 1) struct SBIFileEntry diff --git a/src/util/cubeb_audio_stream.cpp b/src/util/cubeb_audio_stream.cpp index 9cc93bc06..e01cbfe78 100644 --- a/src/util/cubeb_audio_stream.cpp +++ b/src/util/cubeb_audio_stream.cpp @@ -15,7 +15,7 @@ #include "cubeb/cubeb.h" #include "fmt/format.h" -Log_SetChannel(CubebAudioStream); +LOG_CHANNEL(CubebAudioStream); namespace { diff --git a/src/util/cue_parser.cpp b/src/util/cue_parser.cpp index 8fcea9764..f5fbf5a3b 100644 --- a/src/util/cue_parser.cpp +++ b/src/util/cue_parser.cpp @@ -9,7 +9,7 @@ #include -Log_SetChannel(CueParser); +LOG_CHANNEL(CueParser); namespace CueParser { static bool TokenMatch(std::string_view s1, const char* token); diff --git a/src/util/d3d11_device.cpp b/src/util/d3d11_device.cpp index fab554e72..70de26c04 100644 --- a/src/util/d3d11_device.cpp +++ b/src/util/d3d11_device.cpp @@ -22,7 +22,7 @@ #include #include -Log_SetChannel(D3D11Device); +LOG_CHANNEL(D3D11Device); // We need to synchronize instance creation because of adapter enumeration from the UI thread. static std::mutex s_instance_mutex; diff --git a/src/util/d3d11_stream_buffer.cpp b/src/util/d3d11_stream_buffer.cpp index 755b569ec..41b2df4f9 100644 --- a/src/util/d3d11_stream_buffer.cpp +++ b/src/util/d3d11_stream_buffer.cpp @@ -9,7 +9,7 @@ #include "common/error.h" #include "common/log.h" -Log_SetChannel(D3D11Device); +LOG_CHANNEL(D3D11Device); D3D11StreamBuffer::D3D11StreamBuffer() { diff --git a/src/util/d3d11_texture.cpp b/src/util/d3d11_texture.cpp index fa60edc60..9e959b4d0 100644 --- a/src/util/d3d11_texture.cpp +++ b/src/util/d3d11_texture.cpp @@ -13,7 +13,7 @@ #include -Log_SetChannel(D3D11Device); +LOG_CHANNEL(D3D11Device); std::unique_ptr D3D11Device::CreateTexture(u32 width, u32 height, u32 layers, u32 levels, u32 samples, GPUTexture::Type type, GPUTexture::Format format, diff --git a/src/util/d3d12_device.cpp b/src/util/d3d12_device.cpp index e0ac7736e..cfaa0949d 100644 --- a/src/util/d3d12_device.cpp +++ b/src/util/d3d12_device.cpp @@ -27,7 +27,7 @@ #include #include -Log_SetChannel(D3D12Device); +LOG_CHANNEL(D3D12Device); // Tweakables enum : u32 diff --git a/src/util/d3d12_pipeline.cpp b/src/util/d3d12_pipeline.cpp index 95cd292ae..2f364128e 100644 --- a/src/util/d3d12_pipeline.cpp +++ b/src/util/d3d12_pipeline.cpp @@ -14,7 +14,7 @@ #include -Log_SetChannel(D3D12Device); +LOG_CHANNEL(D3D12Device); D3D12Shader::D3D12Shader(GPUShaderStage stage, Bytecode bytecode) : GPUShader(stage), m_bytecode(std::move(bytecode)) { diff --git a/src/util/d3d12_stream_buffer.cpp b/src/util/d3d12_stream_buffer.cpp index ed16213e1..110a11f80 100644 --- a/src/util/d3d12_stream_buffer.cpp +++ b/src/util/d3d12_stream_buffer.cpp @@ -13,7 +13,7 @@ #include -Log_SetChannel(D3D12StreamBuffer); +LOG_CHANNEL(D3D12StreamBuffer); D3D12StreamBuffer::D3D12StreamBuffer() = default; diff --git a/src/util/d3d12_texture.cpp b/src/util/d3d12_texture.cpp index 6e57b80f2..fe128d934 100644 --- a/src/util/d3d12_texture.cpp +++ b/src/util/d3d12_texture.cpp @@ -15,7 +15,7 @@ #include "D3D12MemAlloc.h" -Log_SetChannel(D3D12Device); +LOG_CHANNEL(D3D12Device); D3D12Texture::D3D12Texture(u32 width, u32 height, u32 layers, u32 levels, u32 samples, Type type, Format format, DXGI_FORMAT dxgi_format, ComPtr resource, diff --git a/src/util/d3d_common.cpp b/src/util/d3d_common.cpp index e9b21a3fb..1aa00b3a4 100644 --- a/src/util/d3d_common.cpp +++ b/src/util/d3d_common.cpp @@ -19,7 +19,7 @@ #include #include -Log_SetChannel(D3DCommon); +LOG_CHANNEL(D3DCommon); namespace D3DCommon { namespace { diff --git a/src/util/dinput_source.cpp b/src/util/dinput_source.cpp index aadf9e3da..a8dbf3d11 100644 --- a/src/util/dinput_source.cpp +++ b/src/util/dinput_source.cpp @@ -15,7 +15,7 @@ #include #include -Log_SetChannel(DInputSource); +LOG_CHANNEL(DInputSource); using PFNDIRECTINPUT8CREATE = HRESULT(WINAPI*)(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID* ppvOut, LPUNKNOWN punkOuter); diff --git a/src/util/gpu_device.cpp b/src/util/gpu_device.cpp index 656464f47..989e9f067 100644 --- a/src/util/gpu_device.cpp +++ b/src/util/gpu_device.cpp @@ -25,7 +25,7 @@ #include "spirv_cross/spirv_cross_c.h" #include "xxhash.h" -Log_SetChannel(GPUDevice); +LOG_CHANNEL(GPUDevice); #ifdef _WIN32 #include "common/windows_headers.h" diff --git a/src/util/gpu_shader_cache.cpp b/src/util/gpu_shader_cache.cpp index b056f09f2..9ab35fc3d 100644 --- a/src/util/gpu_shader_cache.cpp +++ b/src/util/gpu_shader_cache.cpp @@ -15,7 +15,7 @@ #include "compress_helpers.h" -Log_SetChannel(GPUShaderCache); +LOG_CHANNEL(GPUShaderCache); #pragma pack(push, 1) struct CacheFileHeader diff --git a/src/util/gpu_texture.cpp b/src/util/gpu_texture.cpp index e07a6d652..aff26f256 100644 --- a/src/util/gpu_texture.cpp +++ b/src/util/gpu_texture.cpp @@ -10,7 +10,7 @@ #include "common/log.h" #include "common/string_util.h" -Log_SetChannel(GPUTexture); +LOG_CHANNEL(GPUTexture); GPUTexture::GPUTexture(u16 width, u16 height, u8 layers, u8 levels, u8 samples, Type type, Format format) : m_width(width), m_height(height), m_layers(layers), m_levels(levels), m_samples(samples), m_type(type), diff --git a/src/util/host.cpp b/src/util/host.cpp index b257d4da9..b7f91be59 100644 --- a/src/util/host.cpp +++ b/src/util/host.cpp @@ -11,7 +11,7 @@ #include #include -Log_SetChannel(Host); +LOG_CHANNEL(Host); namespace Host { static std::pair LookupTranslationString(std::string_view context, std::string_view msg, diff --git a/src/util/http_downloader.cpp b/src/util/http_downloader.cpp index e5d36d35c..abb34a9d2 100644 --- a/src/util/http_downloader.cpp +++ b/src/util/http_downloader.cpp @@ -9,7 +9,7 @@ #include "common/string_util.h" #include "common/timer.h" -Log_SetChannel(HTTPDownloader); +LOG_CHANNEL(HTTPDownloader); static constexpr float DEFAULT_TIMEOUT_IN_SECONDS = 30; static constexpr u32 DEFAULT_MAX_ACTIVE_REQUESTS = 4; diff --git a/src/util/http_downloader_curl.cpp b/src/util/http_downloader_curl.cpp index e6a126782..eca5429d7 100644 --- a/src/util/http_downloader_curl.cpp +++ b/src/util/http_downloader_curl.cpp @@ -13,7 +13,7 @@ #include #include -Log_SetChannel(HTTPDownloader); +LOG_CHANNEL(HTTPDownloader); HTTPDownloaderCurl::HTTPDownloaderCurl() : HTTPDownloader() { diff --git a/src/util/http_downloader_winhttp.cpp b/src/util/http_downloader_winhttp.cpp index 038bf5562..e2518c330 100644 --- a/src/util/http_downloader_winhttp.cpp +++ b/src/util/http_downloader_winhttp.cpp @@ -10,7 +10,7 @@ #include -Log_SetChannel(HTTPDownloader); +LOG_CHANNEL(HTTPDownloader); HTTPDownloaderWinHttp::HTTPDownloaderWinHttp() : HTTPDownloader() { diff --git a/src/util/image.cpp b/src/util/image.cpp index 318a3ae66..4a7201ea7 100644 --- a/src/util/image.cpp +++ b/src/util/image.cpp @@ -23,7 +23,7 @@ #endif // clang-format on -Log_SetChannel(Image); +LOG_CHANNEL(Image); static bool PNGBufferLoader(RGBA8Image* image, const void* buffer, size_t buffer_size); static bool PNGBufferSaver(const RGBA8Image& image, std::vector* buffer, u8 quality); diff --git a/src/util/imgui_fullscreen.cpp b/src/util/imgui_fullscreen.cpp index f55c54c06..bcbb642c5 100644 --- a/src/util/imgui_fullscreen.cpp +++ b/src/util/imgui_fullscreen.cpp @@ -35,7 +35,7 @@ #include #include -Log_SetChannel(ImGuiFullscreen); +LOG_CHANNEL(ImGuiFullscreen); namespace ImGuiFullscreen { using MessageDialogCallbackVariant = std::variant; diff --git a/src/util/imgui_manager.cpp b/src/util/imgui_manager.cpp index abae68198..360482743 100644 --- a/src/util/imgui_manager.cpp +++ b/src/util/imgui_manager.cpp @@ -31,7 +31,7 @@ #include #include -Log_SetChannel(ImGuiManager); +LOG_CHANNEL(ImGuiManager); namespace ImGuiManager { namespace { diff --git a/src/util/ini_settings_interface.cpp b/src/util/ini_settings_interface.cpp index a77355752..614a64fff 100644 --- a/src/util/ini_settings_interface.cpp +++ b/src/util/ini_settings_interface.cpp @@ -13,7 +13,7 @@ #include #include -Log_SetChannel(INISettingsInterface); +LOG_CHANNEL(INISettingsInterface); // To prevent races between saving and loading settings, particularly with game settings, // we only allow one ini to be parsed at any point in time. diff --git a/src/util/input_manager.cpp b/src/util/input_manager.cpp index 3855a7554..4c17cee8c 100644 --- a/src/util/input_manager.cpp +++ b/src/util/input_manager.cpp @@ -28,7 +28,7 @@ #include #include -Log_SetChannel(InputManager); +LOG_CHANNEL(InputManager); namespace { diff --git a/src/util/iso_reader.cpp b/src/util/iso_reader.cpp index 64193d8fb..b42f54e06 100644 --- a/src/util/iso_reader.cpp +++ b/src/util/iso_reader.cpp @@ -12,7 +12,7 @@ #include -Log_SetChannel(IsoReader); +LOG_CHANNEL(IsoReader); IsoReader::IsoReader() = default; diff --git a/src/util/media_capture.cpp b/src/util/media_capture.cpp index d2d98274f..0a2686482 100644 --- a/src/util/media_capture.cpp +++ b/src/util/media_capture.cpp @@ -69,7 +69,7 @@ extern "C" { #endif -Log_SetChannel(MediaCapture); +LOG_CHANNEL(MediaCapture); namespace { diff --git a/src/util/metal_device.mm b/src/util/metal_device.mm index 2616318f8..4ba9d4d28 100644 --- a/src/util/metal_device.mm +++ b/src/util/metal_device.mm @@ -21,7 +21,7 @@ #include #include -Log_SetChannel(MetalDevice); +LOG_CHANNEL(MetalDevice); // TODO: Disable hazard tracking and issue barriers explicitly. @@ -75,9 +75,9 @@ static constexpr std::array(GPUTexture::Format: static void LogNSError(NSError* error, std::string_view message) { - Log::FastWrite("MetalDevice", LOGLEVEL_ERROR, message); - Log::FastWrite("MetalDevice", LOGLEVEL_ERROR, " NSError Code: {}", static_cast(error.code)); - Log::FastWrite("MetalDevice", LOGLEVEL_ERROR, " NSError Description: {}", [error.description UTF8String]); + Log::FastWrite("MetalDevice", Log::Level::Error, message); + Log::FastWrite("MetalDevice", Log::Level::Error, " NSError Code: {}", static_cast(error.code)); + Log::FastWrite("MetalDevice", Log::Level::Error, " NSError Description: {}", [error.description UTF8String]); } static GPUTexture::Format GetTextureFormatForMTLFormat(MTLPixelFormat fmt) diff --git a/src/util/metal_stream_buffer.mm b/src/util/metal_stream_buffer.mm index 4a836a7ff..8fd138b6d 100644 --- a/src/util/metal_stream_buffer.mm +++ b/src/util/metal_stream_buffer.mm @@ -8,7 +8,7 @@ #include "common/assert.h" #include "common/log.h" -Log_SetChannel(MetalDevice); +LOG_CHANNEL(MetalDevice); MetalStreamBuffer::MetalStreamBuffer() = default; diff --git a/src/util/opengl_context.cpp b/src/util/opengl_context.cpp index b78e98be1..cc7240a0e 100644 --- a/src/util/opengl_context.cpp +++ b/src/util/opengl_context.cpp @@ -32,7 +32,7 @@ #endif #endif -Log_SetChannel(OpenGLContext); +LOG_CHANNEL(OpenGLContext); static bool ShouldPreferESContext() { diff --git a/src/util/opengl_context_agl.mm b/src/util/opengl_context_agl.mm index c6ebd58b2..766951ef7 100644 --- a/src/util/opengl_context_agl.mm +++ b/src/util/opengl_context_agl.mm @@ -9,7 +9,7 @@ #include -Log_SetChannel(OpenGLContext); +LOG_CHANNEL(OpenGLContext); OpenGLContextAGL::OpenGLContextAGL(const WindowInfo& wi) : OpenGLContext(wi) { diff --git a/src/util/opengl_context_egl.cpp b/src/util/opengl_context_egl.cpp index 5cf7344f6..6e2507965 100644 --- a/src/util/opengl_context_egl.cpp +++ b/src/util/opengl_context_egl.cpp @@ -13,7 +13,7 @@ #include #include -Log_SetChannel(OpenGLContext); +LOG_CHANNEL(OpenGLContext); static DynamicLibrary s_egl_library; static std::atomic_uint32_t s_egl_refcount = 0; diff --git a/src/util/opengl_context_wgl.cpp b/src/util/opengl_context_wgl.cpp index 145108745..5c7035cca 100644 --- a/src/util/opengl_context_wgl.cpp +++ b/src/util/opengl_context_wgl.cpp @@ -9,7 +9,7 @@ #include "common/log.h" #include "common/scoped_guard.h" -Log_SetChannel(GL::OpenGLContext); +LOG_CHANNEL(GL::OpenGLContext); #ifdef __clang__ #pragma clang diagnostic ignored "-Wmicrosoft-cast" diff --git a/src/util/opengl_device.cpp b/src/util/opengl_device.cpp index ddca2d840..767182538 100644 --- a/src/util/opengl_device.cpp +++ b/src/util/opengl_device.cpp @@ -19,7 +19,7 @@ #include #include -Log_SetChannel(OpenGLDevice); +LOG_CHANNEL(OpenGLDevice); static constexpr const std::array s_draw_buffers = { {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3}}; diff --git a/src/util/opengl_pipeline.cpp b/src/util/opengl_pipeline.cpp index 5b728aa21..b812a78db 100644 --- a/src/util/opengl_pipeline.cpp +++ b/src/util/opengl_pipeline.cpp @@ -21,7 +21,7 @@ #include -Log_SetChannel(OpenGLDevice); +LOG_CHANNEL(OpenGLDevice); struct PipelineDiskCacheFooter { diff --git a/src/util/opengl_texture.cpp b/src/util/opengl_texture.cpp index 4dcbd6c75..33989380e 100644 --- a/src/util/opengl_texture.cpp +++ b/src/util/opengl_texture.cpp @@ -15,7 +15,7 @@ #include #include -Log_SetChannel(OpenGLDevice); +LOG_CHANNEL(OpenGLDevice); // Looking across a range of GPUs, the optimal copy alignment for Vulkan drivers seems // to be between 1 (AMD/NV) and 64 (Intel). So, we'll go with 64 here. diff --git a/src/util/platform_misc_mac.mm b/src/util/platform_misc_mac.mm index a0cf2bbfc..ebc4ce46f 100644 --- a/src/util/platform_misc_mac.mm +++ b/src/util/platform_misc_mac.mm @@ -17,7 +17,7 @@ #include "common/log.h" #include "common/small_string.h" -Log_SetChannel(PlatformMisc); +LOG_CHANNEL(PlatformMisc); #if __has_feature(objc_arc) #error ARC should not be enabled. diff --git a/src/util/platform_misc_unix.cpp b/src/util/platform_misc_unix.cpp index d38a94373..c6d291e3a 100644 --- a/src/util/platform_misc_unix.cpp +++ b/src/util/platform_misc_unix.cpp @@ -16,7 +16,7 @@ #include #include -Log_SetChannel(PlatformMisc); +LOG_CHANNEL(PlatformMisc); bool PlatformMisc::InitializeSocketSupport(Error* error) { diff --git a/src/util/platform_misc_win32.cpp b/src/util/platform_misc_win32.cpp index d394b431c..b5d9e37b3 100644 --- a/src/util/platform_misc_win32.cpp +++ b/src/util/platform_misc_win32.cpp @@ -18,7 +18,7 @@ #include #include -Log_SetChannel(PlatformMisc); +LOG_CHANNEL(PlatformMisc); static bool s_screensaver_suspended = false; static bool s_winsock_initialized = false; diff --git a/src/util/postprocessing.cpp b/src/util/postprocessing.cpp index 3689d74ba..082f10664 100644 --- a/src/util/postprocessing.cpp +++ b/src/util/postprocessing.cpp @@ -26,7 +26,7 @@ #include "common/timer.h" #include "fmt/format.h" -Log_SetChannel(PostProcessing); +LOG_CHANNEL(PostProcessing); // TODO: ProgressCallbacks for shader compiling, it can be a bit slow. // TODO: buffer width/height is wrong on resize, need to change it somehow. diff --git a/src/util/postprocessing_shader.cpp b/src/util/postprocessing_shader.cpp index 55be538dc..7417c9fb4 100644 --- a/src/util/postprocessing_shader.cpp +++ b/src/util/postprocessing_shader.cpp @@ -11,7 +11,7 @@ #include #include -Log_SetChannel(PostProcessing); +LOG_CHANNEL(PostProcessing); void PostProcessing::Shader::ParseKeyValue(std::string_view line, std::string_view* key, std::string_view* value) { diff --git a/src/util/postprocessing_shader_fx.cpp b/src/util/postprocessing_shader_fx.cpp index fa6f6d639..3b95f607c 100644 --- a/src/util/postprocessing_shader_fx.cpp +++ b/src/util/postprocessing_shader_fx.cpp @@ -32,7 +32,7 @@ #include #include -Log_SetChannel(ReShadeFXShader); +LOG_CHANNEL(ReShadeFXShader); static constexpr s32 DEFAULT_BUFFER_WIDTH = 3840; static constexpr s32 DEFAULT_BUFFER_HEIGHT = 2160; diff --git a/src/util/postprocessing_shader_glsl.cpp b/src/util/postprocessing_shader_glsl.cpp index e791dc4e3..ad344df35 100644 --- a/src/util/postprocessing_shader_glsl.cpp +++ b/src/util/postprocessing_shader_glsl.cpp @@ -12,7 +12,7 @@ #include #include -Log_SetChannel(PostProcessing); +LOG_CHANNEL(PostProcessing); namespace { class PostProcessingGLSLShaderGen : public ShaderGen diff --git a/src/util/sdl_audio_stream.cpp b/src/util/sdl_audio_stream.cpp index 2f71ced50..c08a5d33a 100644 --- a/src/util/sdl_audio_stream.cpp +++ b/src/util/sdl_audio_stream.cpp @@ -9,7 +9,7 @@ #include -Log_SetChannel(SDLAudioStream); +LOG_CHANNEL(SDLAudioStream); namespace { class SDLAudioStream final : public AudioStream diff --git a/src/util/sdl_input_source.cpp b/src/util/sdl_input_source.cpp index ada330265..269e815e1 100644 --- a/src/util/sdl_input_source.cpp +++ b/src/util/sdl_input_source.cpp @@ -23,7 +23,7 @@ #include #endif -Log_SetChannel(SDLInputSource); +LOG_CHANNEL(SDLInputSource); static constexpr const char* CONTROLLER_DB_FILENAME = "gamecontrollerdb.txt"; @@ -139,14 +139,14 @@ static void SetControllerRGBLED(SDL_GameController* gc, u32 color) static void SDLLogCallback(void* userdata, int category, SDL_LogPriority priority, const char* message) { - static constexpr LOGLEVEL priority_map[SDL_NUM_LOG_PRIORITIES] = { - LOGLEVEL_DEBUG, - LOGLEVEL_DEBUG, // SDL_LOG_PRIORITY_VERBOSE - LOGLEVEL_DEBUG, // SDL_LOG_PRIORITY_DEBUG - LOGLEVEL_INFO, // SDL_LOG_PRIORITY_INFO - LOGLEVEL_WARNING, // SDL_LOG_PRIORITY_WARN - LOGLEVEL_ERROR, // SDL_LOG_PRIORITY_ERROR - LOGLEVEL_ERROR, // SDL_LOG_PRIORITY_CRITICAL + static constexpr Log::Level priority_map[SDL_NUM_LOG_PRIORITIES] = { + Log::Level::Debug, + Log::Level::Debug, // SDL_LOG_PRIORITY_VERBOSE + Log::Level::Debug, // SDL_LOG_PRIORITY_DEBUG + Log::Level::Info, // SDL_LOG_PRIORITY_INFO + Log::Level::Warning, // SDL_LOG_PRIORITY_WARN + Log::Level::Error, // SDL_LOG_PRIORITY_ERROR + Log::Level::Error, // SDL_LOG_PRIORITY_CRITICAL }; Log::Write("SDL", "SDL", priority_map[priority], message); @@ -191,8 +191,7 @@ void SDLInputSource::UpdateSettings(SettingsInterface& si, std::unique_lock #include -Log_SetChannel(StateWrapper); +LOG_CHANNEL(StateWrapper); StateWrapper::StateWrapper(std::span data, Mode mode, u32 version) : m_data(data.data()), m_size(data.size()), m_mode(mode), m_version(version) diff --git a/src/util/vulkan_builders.cpp b/src/util/vulkan_builders.cpp index 6f7fa4173..1c747b6a5 100644 --- a/src/util/vulkan_builders.cpp +++ b/src/util/vulkan_builders.cpp @@ -106,7 +106,7 @@ const char* Vulkan::VkResultToString(VkResult res) void Vulkan::LogVulkanResult(const char* func_name, VkResult res, std::string_view msg) { - Log::FastWrite("VulkanDevice", func_name, LOGLEVEL_ERROR, "{} (0x{:08X}: {})", msg, static_cast(res), + Log::FastWrite("VulkanDevice", func_name, Log::Level::Error, "{} (0x{:08X}: {})", msg, static_cast(res), VkResultToString(res)); } diff --git a/src/util/vulkan_device.cpp b/src/util/vulkan_device.cpp index b812f73f0..9314faf68 100644 --- a/src/util/vulkan_device.cpp +++ b/src/util/vulkan_device.cpp @@ -27,7 +27,7 @@ #include #include -Log_SetChannel(VulkanDevice); +LOG_CHANNEL(VulkanDevice); // TODO: VK_KHR_display. diff --git a/src/util/vulkan_loader.cpp b/src/util/vulkan_loader.cpp index ea7f67051..0f949d8a7 100644 --- a/src/util/vulkan_loader.cpp +++ b/src/util/vulkan_loader.cpp @@ -16,7 +16,7 @@ #include #include -Log_SetChannel(VulkanDevice); +LOG_CHANNEL(VulkanDevice); extern "C" { diff --git a/src/util/vulkan_pipeline.cpp b/src/util/vulkan_pipeline.cpp index e87a9b1e3..f24aa8d69 100644 --- a/src/util/vulkan_pipeline.cpp +++ b/src/util/vulkan_pipeline.cpp @@ -11,7 +11,7 @@ #include "common/heap_array.h" #include "common/log.h" -Log_SetChannel(VulkanDevice); +LOG_CHANNEL(VulkanDevice); VulkanShader::VulkanShader(GPUShaderStage stage, VkShaderModule mod) : GPUShader(stage), m_module(mod) { diff --git a/src/util/vulkan_stream_buffer.cpp b/src/util/vulkan_stream_buffer.cpp index 21824134c..04065dc61 100644 --- a/src/util/vulkan_stream_buffer.cpp +++ b/src/util/vulkan_stream_buffer.cpp @@ -9,7 +9,7 @@ #include "common/assert.h" #include "common/bitutils.h" #include "common/log.h" -Log_SetChannel(VulkanDevice); +LOG_CHANNEL(VulkanDevice); VulkanStreamBuffer::VulkanStreamBuffer() = default; diff --git a/src/util/vulkan_swap_chain.cpp b/src/util/vulkan_swap_chain.cpp index 5baf36c7c..c45514aef 100644 --- a/src/util/vulkan_swap_chain.cpp +++ b/src/util/vulkan_swap_chain.cpp @@ -20,7 +20,7 @@ #include "util/metal_layer.h" #endif -Log_SetChannel(VulkanDevice); +LOG_CHANNEL(VulkanDevice); static_assert(VulkanSwapChain::NUM_SEMAPHORES == (VulkanDevice::NUM_COMMAND_BUFFERS + 1)); diff --git a/src/util/vulkan_texture.cpp b/src/util/vulkan_texture.cpp index 80f54b385..83bfc7b21 100644 --- a/src/util/vulkan_texture.cpp +++ b/src/util/vulkan_texture.cpp @@ -10,7 +10,7 @@ #include "common/bitutils.h" #include "common/log.h" -Log_SetChannel(VulkanDevice); +LOG_CHANNEL(VulkanDevice); static constexpr const VkComponentMapping s_identity_swizzle{ VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, diff --git a/src/util/wav_writer.cpp b/src/util/wav_writer.cpp index 0084833d9..877918467 100644 --- a/src/util/wav_writer.cpp +++ b/src/util/wav_writer.cpp @@ -4,7 +4,7 @@ #include "wav_writer.h" #include "common/file_system.h" #include "common/log.h" -Log_SetChannel(WAVWriter); +LOG_CHANNEL(WAVWriter); namespace { #pragma pack(push, 1) diff --git a/src/util/win32_raw_input_source.cpp b/src/util/win32_raw_input_source.cpp index 52e2da894..116b0b364 100644 --- a/src/util/win32_raw_input_source.cpp +++ b/src/util/win32_raw_input_source.cpp @@ -15,7 +15,7 @@ #include #include -Log_SetChannel(Win32RawInputSource); +LOG_CHANNEL(Win32RawInputSource); static const wchar_t* WINDOW_CLASS_NAME = L"Win32RawInputSource"; static bool s_window_class_registered = false; diff --git a/src/util/window_info.cpp b/src/util/window_info.cpp index fa307fb98..7c19abeed 100644 --- a/src/util/window_info.cpp +++ b/src/util/window_info.cpp @@ -9,7 +9,7 @@ #include "common/log.h" #include "common/scoped_guard.h" -Log_SetChannel(WindowInfo); +LOG_CHANNEL(WindowInfo); void WindowInfo::SetSurfaceless() { diff --git a/src/util/xinput_source.cpp b/src/util/xinput_source.cpp index d591e5201..6627af0e1 100644 --- a/src/util/xinput_source.cpp +++ b/src/util/xinput_source.cpp @@ -13,7 +13,7 @@ #include -Log_SetChannel(XInputSource); +LOG_CHANNEL(XInputSource); static const char* s_axis_names[XInputSource::NUM_AXES] = { "LeftX", // AXIS_LEFTX