From b46566adc2cf8795bcde5dfa1cbfb4af0717c283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 29 Jul 2026 14:42:24 +0200 Subject: [PATCH] Logging improvements --- Common/GPU/OpenGL/GLRenderManager.cpp | 2 +- Common/GPU/Vulkan/VulkanRenderManager.cpp | 2 +- Common/GPU/thin3d.cpp | 1 + Common/LogReporting.cpp | 18 +++++++++--------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Common/GPU/OpenGL/GLRenderManager.cpp b/Common/GPU/OpenGL/GLRenderManager.cpp index 8a0960f425..426b344b21 100644 --- a/Common/GPU/OpenGL/GLRenderManager.cpp +++ b/Common/GPU/OpenGL/GLRenderManager.cpp @@ -54,7 +54,7 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) { renderThreadId = std::this_thread::get_id(); if (newInflightFrames_ != -1) { - INFO_LOG(Log::G3D, "Updating inflight frames to %d", newInflightFrames_); + INFO_LOG(Log::G3D, "OpenGL: Updating inflight frames to %d", newInflightFrames_); inflightFrames_ = newInflightFrames_; newInflightFrames_ = -1; } diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 4f580d5f26..fbe280c569 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -333,7 +333,7 @@ bool VulkanRenderManager::CreateBackbuffers() { curHeightRaw_ = -1; if (newInflightFrames_ != -1) { - INFO_LOG(Log::G3D, "Updating inflight frames to %d", newInflightFrames_); + INFO_LOG(Log::G3D, "Vulkan: Updating inflight frames to %d", newInflightFrames_); vulkan_->UpdateInflightFrames(newInflightFrames_); newInflightFrames_ = -1; } diff --git a/Common/GPU/thin3d.cpp b/Common/GPU/thin3d.cpp index 5a8bc6f22a..224a26507f 100644 --- a/Common/GPU/thin3d.cpp +++ b/Common/GPU/thin3d.cpp @@ -289,6 +289,7 @@ static ShaderModule *GenerateFShader(DrawContext *draw, FragmentShaderPreset pre } bool DrawContext::CreatePresets() { + INFO_LOG(Log::G3D, "Creating thin3d preset shaders..."); bool tintSupported = !bugs_.Has(Bugs::RASPBERRY_SHADER_COMP_HANG); for (int i = 0; i < VS_MAX_PRESET; i++) { diff --git a/Common/LogReporting.cpp b/Common/LogReporting.cpp index 9f41875aa0..b5909be304 100644 --- a/Common/LogReporting.cpp +++ b/Common/LogReporting.cpp @@ -58,14 +58,6 @@ void SetupCallbacks(AllowedCallback allowed, MessageCallback message) { } void ReportMessage(const char *message, ...) { - if (!allowedCallback || !messageCallback) { - ERROR_LOG(Log::System, "Reporting not initialized, skipping: %s", message); - return; - } - - if (!allowedCallback()) - return; - const int MESSAGE_BUFFER_SIZE = 65536; char *temp = new char [MESSAGE_BUFFER_SIZE]; @@ -75,6 +67,14 @@ void ReportMessage(const char *message, ...) { temp[MESSAGE_BUFFER_SIZE - 1] = '\0'; va_end(args); + if (!allowedCallback || !messageCallback) { + ERROR_LOG(Log::System, "Reporting not initialized, skipping: %s", temp); + return; + } + + if (!allowedCallback()) + return; + messageCallback(message, temp); delete[] temp; @@ -82,7 +82,7 @@ void ReportMessage(const char *message, ...) { void ReportMessageFormatted(const char *message, const char *formatted) { if (!allowedCallback || !messageCallback) { - ERROR_LOG(Log::System, "Reporting not initialized, skipping: %s", message); + ERROR_LOG(Log::System, "Reporting not initialized, skipping: %s", formatted); return; }