diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.cpp b/Common/GPU/Vulkan/VulkanQueueRunner.cpp index 2ad9cbeeb0..8e1282c51d 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.cpp +++ b/Common/GPU/Vulkan/VulkanQueueRunner.cpp @@ -43,7 +43,7 @@ RenderPassType MergeRPTypes(RenderPassType a, RenderPassType b) { } void VulkanQueueRunner::CreateDeviceObjects() { - INFO_LOG(Log::G3D, "VulkanQueueRunner::CreateDeviceObjects"); + DEBUG_LOG(Log::G3D, "VulkanQueueRunner::CreateDeviceObjects"); RPKey key{ VKRRenderPassLoadAction::CLEAR, VKRRenderPassLoadAction::CLEAR, VKRRenderPassLoadAction::CLEAR, @@ -67,7 +67,7 @@ void VulkanQueueRunner::CreateDeviceObjects() { } void VulkanQueueRunner::DestroyDeviceObjects() { - INFO_LOG(Log::G3D, "VulkanQueueRunner::DestroyDeviceObjects"); + DEBUG_LOG(Log::G3D, "VulkanQueueRunner::DestroyDeviceObjects"); syncReadback_.Destroy(vulkan_); diff --git a/Common/Net/HTTPClient.cpp b/Common/Net/HTTPClient.cpp index bbc8e09c75..a2743f0213 100644 --- a/Common/Net/HTTPClient.cpp +++ b/Common/Net/HTTPClient.cpp @@ -141,7 +141,7 @@ bool Connection::Connect(int maxTries, double timeout, bool *cancelConnect) { if (!unreachable) { ERROR_LOG(Log::HTTP, "connect(%d) call to %s failed (%d: %s)", sock, addrStr, errorCode, errorString.c_str()); } else { - INFO_LOG(Log::HTTP, "connect(%d): Ignoring unreachable resolved address %s", sock, addrStr); + VERBOSE_LOG(Log::HTTP, "connect(%d): Ignoring unreachable resolved address %s", sock, addrStr); } closesocket(sock); continue; diff --git a/Common/Render/Text/draw_text_sdl.cpp b/Common/Render/Text/draw_text_sdl.cpp index 3b314311aa..cde252b9a4 100644 --- a/Common/Render/Text/draw_text_sdl.cpp +++ b/Common/Render/Text/draw_text_sdl.cpp @@ -292,13 +292,13 @@ void TextDrawerSDL::SetOrCreateFont(const FontStyle &style) { uint8_t *fileData = nullptr; std::string useFont = GetFilenameForFontStyle(style) + ".ttf"; const int ptSize = static_cast(style.sizePts / dpiScale_ * 1.25f); - INFO_LOG(Log::G3D, "Loading SDL font '%s' from VFS at size %d pts", useFont.c_str(), ptSize); + DEBUG_LOG(Log::G3D, "Loading SDL font '%s' from VFS at size %d pts", useFont.c_str(), ptSize); size_t fileSz; fileData = g_VFS.ReadFile(useFont.c_str(), &fileSz); if (fileData) { SDL_IOStream *rw = SDL_IOFromConstMem(fileData, fileSz); - INFO_LOG(Log::G3D, "Opened font from RW: '%p' '%d'", fileData, (int)fileSz); + DEBUG_LOG(Log::G3D, "Opened font from RW: '%p' '%d'", fileData, (int)fileSz); font = TTF_OpenFontIO(rw, true, static_cast(ptSize)); if (!font) { ERROR_LOG(Log::G3D, "Failed to load font from asset file: '%s'", useFont.c_str()); diff --git a/Core/Config.cpp b/Core/Config.cpp index 07ea027eff..04eb036dd1 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1464,7 +1464,7 @@ bool Config::Save(const char *saveReason) { } if (!ShouldSaveSetting(meta.settings[j].GetVoidPtr(configBlock))) { // Skip settings marked as "don't save". - INFO_LOG(Log::Config, "Not saving setting '%.*s' as marked as don't save.", STR_VIEW(meta.settings[j].IniKey())); + DEBUG_LOG(Log::Config, "Not saving setting '%.*s' as marked as don't save.", STR_VIEW(meta.settings[j].IniKey())); continue; } meta.settings[j].WriteToIniSection(configBlock, section); diff --git a/Core/ELF/ElfReader.cpp b/Core/ELF/ElfReader.cpp index 658d668b18..6bdb048bd5 100644 --- a/Core/ELF/ElfReader.cpp +++ b/Core/ELF/ElfReader.cpp @@ -560,7 +560,7 @@ int ElfReader::LoadInto(u32 loadAddress, bool fromTop) { } } } - memblock.ListBlocks(); + memblock.ListBlocks(LogLevel::LDEBUG); DEBUG_LOG(Log::Loader, "%d sections:", header->e_shnum); diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 939fbe0fe9..77f039119a 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -371,18 +371,18 @@ void __KernelMemoryDoState(PointerWrap &p) void __KernelMemoryShutdown() { #ifdef _DEBUG - INFO_LOG(Log::sceKernel, "Shutting down volatile memory pool: "); - volatileMemory.ListBlocks(); + DEBUG_LOG(Log::sceKernel, "Shutting down volatile memory pool"); + volatileMemory.ListBlocks(LogLevel::LDEBUG); #endif volatileMemory.Shutdown(); #ifdef _DEBUG - INFO_LOG(Log::sceKernel,"Shutting down user memory pool: "); - userMemory.ListBlocks(); + DEBUG_LOG(Log::sceKernel,"Shutting down user memory pool"); + userMemory.ListBlocks(LogLevel::LDEBUG); #endif userMemory.Shutdown(); #ifdef _DEBUG - INFO_LOG(Log::sceKernel,"Shutting down \"kernel\" memory pool: "); - kernelMemory.ListBlocks(); + DEBUG_LOG(Log::sceKernel,"Shutting down \"kernel\" memory pool"); + kernelMemory.ListBlocks(LogLevel::LDEBUG); #endif kernelMemory.Shutdown(); tlsplThreadEndChecks.clear(); @@ -823,7 +823,7 @@ public: else address = alloc->Alloc(size, type == PSP_SMEM_High, name); #ifdef _DEBUG - alloc->ListBlocks(); + alloc->ListBlocks(LogLevel::LDEBUG); #endif } } @@ -1914,7 +1914,7 @@ SceUID sceKernelCreateTlspl(const char *name, u32 partition, u32 attr, u32 block u32 totalSize = alignedSize * count; u32 blockPtr = allocator->Alloc(totalSize, (attr & PSP_TLSPL_ATTR_HIGHMEM) != 0, StringFromFormat("TLS/%s", name).c_str()); #ifdef _DEBUG - allocator->ListBlocks(); + allocator->ListBlocks(LogLevel::LDEBUG); #endif if (blockPtr == (u32)-1) diff --git a/Core/Util/BlockAllocator.cpp b/Core/Util/BlockAllocator.cpp index 85d5265d98..b680fefaa1 100644 --- a/Core/Util/BlockAllocator.cpp +++ b/Core/Util/BlockAllocator.cpp @@ -134,7 +134,7 @@ u32 BlockAllocator::AllocAligned(u32 &size, u32 sizeGrain, u32 grain, bool fromT } //Out of memory :( - ListBlocks(); + ListBlocks(LogLevel::LINFO); ERROR_LOG(Log::sceKernel, "Block Allocator (%08x-%08x) failed to allocate %i (%08x) bytes of contiguous memory", rangeStart_, rangeStart_ + rangeSize_, size, size); return -1; } @@ -215,7 +215,7 @@ u32 BlockAllocator::AllocAt(u32 position, u32 size, const char *tag) //Out of memory :( - ListBlocks(); + ListBlocks(LogLevel::LINFO); ERROR_LOG(Log::sceKernel, "Block Allocator (%08x-%08x) failed to allocate %i (%08x) bytes of contiguous memory", rangeStart_, rangeStart_ + rangeSize_, alignedSize, alignedSize); return -1; } @@ -387,15 +387,14 @@ u32 BlockAllocator::GetBlockSizeFromAddress(u32 addr) const return -1; } -void BlockAllocator::ListBlocks() const -{ - DEBUG_LOG(Log::sceKernel,"-----------"); +void BlockAllocator::ListBlocks(LogLevel level) const { + GENERIC_LOG(Log::sceKernel, level, "-----------"); for (const Block *bp = bottom_; bp != NULL; bp = bp->next) { const Block &b = *bp; - DEBUG_LOG(Log::sceKernel, "Block: %08x - %08x size %08x taken=%i tag=%s", b.start, b.start+b.size, b.size, b.taken ? 1:0, b.tag); + GENERIC_LOG(Log::sceKernel, level, "Block: %08x - %08x size %08x taken=%i tag=%s", b.start, b.start+b.size, b.size, b.taken ? 1:0, b.tag); } - DEBUG_LOG(Log::sceKernel,"-----------"); + GENERIC_LOG(Log::sceKernel, level, "-----------"); } u32 BlockAllocator::GetLargestFreeBlockSize() const diff --git a/Core/Util/BlockAllocator.h b/Core/Util/BlockAllocator.h index 10949bd60e..e98ae8aad2 100644 --- a/Core/Util/BlockAllocator.h +++ b/Core/Util/BlockAllocator.h @@ -21,6 +21,8 @@ class PointerWrap; #include "Common/CommonTypes.h" +#include "Common/Log.h" + class BlockAllocator { public: @@ -30,7 +32,7 @@ public: void Init(u32 _rangeStart, u32 _rangeSize, bool suballoc); void Shutdown(); - void ListBlocks() const; + void ListBlocks(LogLevel level) const; // WARNING: size can be modified upwards! u32 Alloc(u32 &size, bool fromTop = false, const char *tag = 0); diff --git a/SDL/SDLJoystick.cpp b/SDL/SDLJoystick.cpp index d681c0cad0..6c8dad665a 100644 --- a/SDL/SDLJoystick.cpp +++ b/SDL/SDLJoystick.cpp @@ -25,11 +25,10 @@ SDLJoystick::SDLJoystick(bool init_SDL ) : registeredAsEventHandler(false) { } const char *dbPath = "gamecontrollerdb.txt"; - INFO_LOG(Log::System, "loading control pad mappings from %s:", dbPath); - size_t size; u8 *mappingData = g_VFS.ReadFile(dbPath, &size); if (mappingData) { + DEBUG_LOG(Log::System, "loading control pad mappings from '%s'", dbPath); SDL_IOStream *io = SDL_IOFromConstMem(mappingData, size); if (SDL_AddGamepadMappingsFromIO(io, true) == -1) { ERROR_LOG(Log::System, "Failed to read mapping data - corrupt?"); diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index db5f7e28be..65b1a59eb2 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -1521,7 +1521,6 @@ static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputSta switch (event.button.button) { case SDL_BUTTON_LEFT: { - INFO_LOG(Log::UI, "SDL_EVENT_MOUSE_BUTTON_DOWN: %f x %f", event.button.x, event.button.y); // We have to juggle around 3 kinds of "DPI spaces" if a logical DPI is // provided (through --dpi, it is equal to system DPI if unspecified): // - SDL gives us motion events in "system DPI" points diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 71ad7df558..e715adbb2d 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -223,6 +223,8 @@ class GlobalListener : public ControlListener { g_Config.bShowImDebugger = !g_Config.bShowImDebugger; } break; + default: + break; } } }; @@ -801,7 +803,6 @@ void NativeInit(int argc, const char *argv[], const CommandLineOptions &cmdLineO ApplyAchievementsHostOverride(); - DEBUG_LOG(Log::System, "ScreenManager!"); g_screenManager = new ScreenManager(); if (g_Config.memStickDirectory.empty()) { INFO_LOG(Log::System, "No memstick directory! Asking for one to be configured."); @@ -1203,6 +1204,8 @@ void NativeFrame(GraphicsContext *graphicsContext) { case QueuedEventType::TOUCH: ImGui_ImplPlatform_TouchEvent(event.touch); break; + default: + break; } } }