diff --git a/Core/Config.cpp b/Core/Config.cpp index f7fd8e9af9..8e53ab9200 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -527,7 +527,7 @@ static int DefaultInternalResolution() { #else int longestDisplaySide = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)); int scale = longestDisplaySide >= 1000 ? 2 : 1; - ILOG("Longest display side: %d pixels. Choosing scale %d", longestDisplaySide, scale); + INFO_LOG(G3D, "Longest display side: %d pixels. Choosing scale %d", longestDisplaySide, scale); return scale; #endif } diff --git a/Core/Core.cpp b/Core/Core.cpp index 01b2970cda..acb1ad44c6 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -190,7 +190,7 @@ bool UpdateScreenScale(int width, int height) { dp_yres = new_dp_yres; pixel_xres = width; pixel_yres = height; - ILOG("pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres); + INFO_LOG(G3D, "pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres); NativeResized(); return true; } diff --git a/Core/MIPS/ARM/ArmJit.cpp b/Core/MIPS/ARM/ArmJit.cpp index 829307b419..5a8316f06b 100644 --- a/Core/MIPS/ARM/ArmJit.cpp +++ b/Core/MIPS/ARM/ArmJit.cpp @@ -62,13 +62,13 @@ void DisassembleArm(const u8 *data, int size) { int reg1 = (next & 0x0000F000) >> 12; if (reg0 == reg1) { sprintf(temp, "%08x MOV32 %s, %04x%04x", (u32)inst, ArmRegName(reg0), hi, low); - ILOG("A: %s", temp); + INFO_LOG(JIT, "A: %s", temp); i += 4; continue; } } ArmDis((u32)codePtr, inst, temp, sizeof(temp), true); - ILOG("A: %s", temp); + INFO_LOG(JIT, "A: %s", temp); } } diff --git a/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp b/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp index ebb0d09494..fffb38fcc7 100644 --- a/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp +++ b/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp @@ -400,7 +400,7 @@ void Arm64RegCacheFPU::FlushAll() { if (ar[a].isDirty) { if (m == -1) { - INFO_LOG(JIT, "ARM reg %i is dirty but has no mipsreg", a); + INFO_LOG(JIT, "ARM reg %d is dirty but has no mipsreg", a); continue; } @@ -423,7 +423,7 @@ void Arm64RegCacheFPU::FlushAll() { // Sanity check for (int i = 0; i < numARMFpuReg_; i++) { if (ar[i].mipsReg != -1) { - ERROR_LOG(JIT, "Flush fail: ar[%i].mipsReg=%i", i, ar[i].mipsReg); + ERROR_LOG(JIT, "Flush fail: ar[%d].mipsReg=%d", i, ar[i].mipsReg); } } pendingFlush = false; diff --git a/GPU/Common/ShaderTranslation.cpp b/GPU/Common/ShaderTranslation.cpp index d535d063c1..e0b58908fc 100644 --- a/GPU/Common/ShaderTranslation.cpp +++ b/GPU/Common/ShaderTranslation.cpp @@ -252,8 +252,8 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade shaderStrings[0] = src.c_str(); shader.setStrings(shaderStrings, 1); if (!shader.parse(&Resources, 100, EProfile::ECompatibilityProfile, false, false, messages)) { - ELOG("%s", shader.getInfoLog()); - ELOG("%s", shader.getInfoDebugLog()); + ERROR_LOG(G3D, "%s", shader.getInfoLog()); + ERROR_LOG(G3D, "%s", shader.getInfoDebugLog()); if (errorMessage) { *errorMessage = shader.getInfoLog(); (*errorMessage) += shader.getInfoDebugLog(); @@ -265,8 +265,8 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade program.addShader(&shader); if (!program.link(messages)) { - ELOG("%s", shader.getInfoLog()); - ELOG("%s", shader.getInfoDebugLog()); + ERROR_LOG(G3D, "%s", shader.getInfoLog()); + ERROR_LOG(G3D, "%s", shader.getInfoDebugLog()); if (errorMessage) { *errorMessage = shader.getInfoLog(); (*errorMessage) += shader.getInfoDebugLog(); diff --git a/GPU/Directx9/ShaderManagerDX9.cpp b/GPU/Directx9/ShaderManagerDX9.cpp index 64a1d28137..15cb7777e8 100644 --- a/GPU/Directx9/ShaderManagerDX9.cpp +++ b/GPU/Directx9/ShaderManagerDX9.cpp @@ -23,6 +23,7 @@ #include #include "gfx/d3d9_shader.h" +#include "base/logging.h" // For OutputDebugStringUTF8 #include "base/stringutil.h" #include "i18n/i18n.h" #include "math/lin/matrix4x4.h" @@ -32,6 +33,7 @@ #include "util/text/utf8.h" #include "Common/Common.h" +#include "Common/Log.h" #include "Core/Config.h" #include "Core/Host.h" #include "Core/Reporting.h" diff --git a/GPU/Directx9/StencilBufferDX9.cpp b/GPU/Directx9/StencilBufferDX9.cpp index 4310a1654e..722a43b31f 100644 --- a/GPU/Directx9/StencilBufferDX9.cpp +++ b/GPU/Directx9/StencilBufferDX9.cpp @@ -17,6 +17,7 @@ #include +#include "base/logging.h" // For OutputDebugStringUTF8 #include "gfx/d3d9_state.h" #include "ext/native/thin3d/thin3d.h" #include "Core/Reporting.h" diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index 40fda18e5e..8c9df27705 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -310,7 +310,7 @@ void GPU_GLES::BuildReportingInfo() { } void GPU_GLES::DeviceLost() { - ILOG("GPU_GLES: DeviceLost"); + INFO_LOG(G3D, "GPU_GLES: DeviceLost"); // Simply drop all caches and textures. // FBOs appear to survive? Or no? @@ -328,7 +328,7 @@ void GPU_GLES::DeviceLost() { void GPU_GLES::DeviceRestore() { draw_ = (Draw::DrawContext *)PSP_CoreParameter().graphicsContext->GetDrawContext(); - ILOG("GPU_GLES: DeviceRestore"); + INFO_LOG(G3D, "GPU_GLES: DeviceRestore"); UpdateCmdInfo(); UpdateVsyncInterval(true); diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 6442b3e8d7..c2ba043348 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -471,7 +471,7 @@ void GPU_Vulkan::ExecuteOp(u32 op, u32 diff) { } void GPU_Vulkan::InitDeviceObjects() { - ILOG("GPU_Vulkan::InitDeviceObjects"); + INFO_LOG(G3D, "GPU_Vulkan::InitDeviceObjects"); // Initialize framedata for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) { assert(!frameData_[i].push_); @@ -495,7 +495,7 @@ void GPU_Vulkan::InitDeviceObjects() { } void GPU_Vulkan::DestroyDeviceObjects() { - ILOG("GPU_Vulkan::DestroyDeviceObjects"); + INFO_LOG(G3D, "GPU_Vulkan::DestroyDeviceObjects"); for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) { if (frameData_[i].push_) { frameData_[i].push_->Destroy(vulkan_); diff --git a/SDL/SDLCocoaMetalLayer.mm b/SDL/SDLCocoaMetalLayer.mm index d0df82716b..c45158ff5d 100644 --- a/SDL/SDLCocoaMetalLayer.mm +++ b/SDL/SDLCocoaMetalLayer.mm @@ -5,7 +5,6 @@ #endif #import -#include "base/logging.h" #include "SDLCocoaMetalLayer.h" void *makeWindowMetalCompatible(void *window) { diff --git a/UI/BackgroundAudio.cpp b/UI/BackgroundAudio.cpp index 1de2def802..a061af2056 100644 --- a/UI/BackgroundAudio.cpp +++ b/UI/BackgroundAudio.cpp @@ -84,9 +84,9 @@ void WavData::Read(RIFFReader &file_) { } } file_.Ascend(); - // ILOG("got fmt data: %i", samplesPerSec); + // INFO_LOG(AUDIO, "got fmt data: %i", samplesPerSec); } else { - ELOG("Error - no format chunk in wav"); + ERROR_LOG(AUDIO, "Error - no format chunk in wav"); file_.Ascend(); return; } @@ -142,20 +142,20 @@ void WavData::Read(RIFFReader &file_) { if (num_channels == 1 || num_channels == 2) { file_.ReadData(raw_data, numBytes); } else { - ELOG("Error - bad blockalign or channels"); + ERROR_LOG(AUDIO, "Error - bad blockalign or channels"); free(raw_data); raw_data = nullptr; return; } file_.Ascend(); } else { - ELOG("Error - no data chunk in wav"); + ERROR_LOG(AUDIO, "Error - no data chunk in wav"); file_.Ascend(); return; } file_.Ascend(); } else { - ELOG("Could not descend into RIFF file."); + ERROR_LOG(AUDIO, "Could not descend into RIFF file."); return; } sample_rate = samplesPerSec; @@ -269,7 +269,7 @@ BackgroundAudio::Sample *BackgroundAudio::LoadSample(const std::string &path) { delete [] data; if (wave.num_channels != 2 || wave.sample_rate != 44100 || wave.raw_bytes_per_frame != 4) { - ELOG("Wave format not supported for mixer playback. Must be 16-bit raw stereo. '%s'", path.c_str()); + ERROR_LOG(AUDIO, "Wave format not supported for mixer playback. Must be 16-bit raw stereo. '%s'", path.c_str()); return nullptr; } diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 3d711eda2f..1cf93ebb44 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -34,6 +34,7 @@ #include "Core/Host.h" #include "Core/HLE/sceCtrl.h" #include "Core/System.h" +#include "Common/Log.h" #include "Common/KeyMap.h" #include "Core/Config.h" #include "UI/ControlMappingScreen.h" @@ -581,7 +582,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) { bool found = false; for (int i = 0; i < MAX_TOUCH_POINTS; i++) { if (touches_[i].id == touch.id) { - WLOG("Double touch"); + WARN_LOG(SYSTEM, "Double touch"); touches_[i].x = touch.x; touches_[i].y = touch.y; found = true; @@ -608,7 +609,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) { } } if (!found) { - WLOG("Move without touch down: %d", touch.id); + WARN_LOG(SYSTEM, "Move without touch down: %d", touch.id); } } if (touch.flags & TOUCH_UP) { @@ -621,7 +622,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) { } } if (!found) { - WLOG("Touch release without touch down"); + WARN_LOG(SYSTEM, "Touch release without touch down"); } } return true; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 4734b179a6..bcb0a293c5 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -998,19 +998,19 @@ UI::EventReturn GameSettingsScreen::OnHardwareTransform(UI::EventParams &e) { } UI::EventReturn GameSettingsScreen::OnScreenRotation(UI::EventParams &e) { - ILOG("New display rotation: %d", g_Config.iScreenRotation); - ILOG("Sending rotate"); + INFO_LOG(SYSTEM, "New display rotation: %d", g_Config.iScreenRotation); + INFO_LOG(SYSTEM, "Sending rotate"); System_SendMessage("rotate", ""); - ILOG("Got back from rotate"); + INFO_LOG(SYSTEM, "Got back from rotate"); return UI::EVENT_DONE; } void RecreateActivity() { const int SYSTEM_JELLYBEAN = 16; if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= SYSTEM_JELLYBEAN) { - ILOG("Sending recreate"); + INFO_LOG(SYSTEM, "Sending recreate"); System_SendMessage("recreate", ""); - ILOG("Got back from recreate"); + INFO_LOG(SYSTEM, "Got back from recreate"); } else { auto gr = GetI18NCategory("Graphics"); System_SendMessage("toast", gr->T("Must Restart", "You must restart PPSSPP for this change to take effect")); diff --git a/UI/Store.cpp b/UI/Store.cpp index f52a1ae916..fd27021106 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -370,7 +370,7 @@ void StoreScreen::update() { RecreateViews(); } else { // Failed to contact store. Don't do anything. - ELOG("Download failed : error code %d", listing_->ResultCode()); + ERROR_LOG(IO, "Download failed : error code %d", listing_->ResultCode()); connectionError_ = true; loading_ = false; RecreateViews(); @@ -398,7 +398,7 @@ void StoreScreen::ParseListing(std::string json) { using namespace json; JsonReader reader(json.c_str(), json.size()); if (!reader.ok() || !reader.root()) { - ELOG("Error parsing JSON from store"); + ERROR_LOG(IO, "Error parsing JSON from store"); connectionError_ = true; RecreateViews(); return; diff --git a/UI/TextureUtil.cpp b/UI/TextureUtil.cpp index 0d05bbc448..dc0cfa2355 100644 --- a/UI/TextureUtil.cpp +++ b/UI/TextureUtil.cpp @@ -43,7 +43,7 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty type = DetectImageFileType(data, size); } if (type == TYPE_UNKNOWN) { - ELOG("File (size: %d) has unknown format", (int)size); + ERROR_LOG(G3D, "File (size: %d) has unknown format", (int)size); return false; } @@ -63,11 +63,11 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty *num_levels = 1; *fmt = Draw::DataFormat::R8G8B8A8_UNORM; if (!image[0]) { - ELOG("WTF"); + ERROR_LOG(IO, "WTF"); return false; } } else { - ELOG("PNG load failed"); + ERROR_LOG(IO, "PNG load failed"); return false; } break; @@ -85,7 +85,7 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty break; default: - ELOG("Unsupported image format %d", (int)type); + ERROR_LOG(IO, "Unsupported image format %d", (int)type); return false; } @@ -111,7 +111,7 @@ bool ManagedTexture::LoadFromFileData(const uint8_t *data, size_t dataSize, Imag } if (num_levels < 0 || num_levels >= 16) { - ELOG("Invalid num_levels: %d. Falling back to one. Image: %dx%d", num_levels, width[0], height[0]); + ERROR_LOG(IO, "Invalid num_levels: %d. Falling back to one. Image: %dx%d", num_levels, width[0], height[0]); num_levels = 1; } @@ -149,7 +149,7 @@ bool ManagedTexture::LoadFromFile(const std::string &filename, ImageFileType typ uint8_t *buffer = VFSReadFile(filename.c_str(), &fileSize); if (!buffer) { filename_ = ""; - ELOG("Failed to read file '%s'", filename.c_str()); + ERROR_LOG(IO, "Failed to read file '%s'", filename.c_str()); return false; } bool retval = LoadFromFileData(buffer, fileSize, type, generateMips, filename.c_str()); @@ -157,7 +157,7 @@ bool ManagedTexture::LoadFromFile(const std::string &filename, ImageFileType typ filename_ = filename; } else { filename_ = ""; - ELOG("Failed to load texture '%s'", filename.c_str()); + ERROR_LOG(IO, "Failed to load texture '%s'", filename.c_str()); } delete[] buffer; return retval; @@ -176,14 +176,14 @@ std::unique_ptr CreateTextureFromFile(Draw::DrawContext *draw, c } void ManagedTexture::DeviceLost() { - ILOG("ManagedTexture::DeviceLost(%s)", filename_.c_str()); + INFO_LOG(G3D, "ManagedTexture::DeviceLost(%s)", filename_.c_str()); if (texture_) texture_->Release(); texture_ = nullptr; } void ManagedTexture::DeviceRestored(Draw::DrawContext *draw) { - ILOG("ManagedTexture::DeviceRestored(%s)", filename_.c_str()); + INFO_LOG(G3D, "ManagedTexture::DeviceRestored(%s)", filename_.c_str()); _assert_(!texture_); draw_ = draw; // Vulkan: Can't load textures before the first frame has started. @@ -194,7 +194,7 @@ void ManagedTexture::DeviceRestored(Draw::DrawContext *draw) { Draw::Texture *ManagedTexture::GetTexture() { if (loadPending_) { if (!LoadFromFile(filename_, ImageFileType::DETECT, generateMips_)) { - ELOG("ManagedTexture failed: '%s'", filename_.c_str()); + ERROR_LOG(IO, "ManagedTexture failed: '%s'", filename_.c_str()); } loadPending_ = false; } diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index e895ebd384..f8835f1e74 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -448,7 +448,7 @@ UI::EventReturn TouchControlLayoutScreen::OnVisibility(UI::EventParams &e) { } UI::EventReturn TouchControlLayoutScreen::OnReset(UI::EventParams &e) { - ILOG("Resetting touch control layout"); + INFO_LOG(G3D, "Resetting touch control layout"); g_Config.ResetControlLayout(); const Bounds &bounds = screenManager()->getUIContext()->GetBounds(); InitPadLayout(bounds.w, bounds.h); diff --git a/UWP/StorageFolderBrowser.cpp b/UWP/StorageFolderBrowser.cpp index e5c6149d4c..3744b3e6dd 100644 --- a/UWP/StorageFolderBrowser.cpp +++ b/UWP/StorageFolderBrowser.cpp @@ -1,7 +1,6 @@ #include "pch.h" #include "ppltasks.h" -#include "base/logging.h" #include "thread/threadutil.h" #include "StorageFolderBrowser.h" diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 7239929dae..83ce9471f7 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -104,7 +104,7 @@ static void EmuThreadStop() { static void EmuThreadJoin() { emuThread.join(); emuThread = std::thread(); - ILOG("EmuThreadJoin - joined"); + INFO_LOG(SYSTEM, "EmuThreadJoin - joined"); } void MainThreadFunc() { diff --git a/Windows/GPU/D3D9Context.cpp b/Windows/GPU/D3D9Context.cpp index c948654b98..0014c31121 100644 --- a/Windows/GPU/D3D9Context.cpp +++ b/Windows/GPU/D3D9Context.cpp @@ -71,7 +71,7 @@ bool D3D9Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { hD3D9_ = LoadLibrary(TEXT("d3d9.dll")); if (!hD3D9_) { - ELOG("Missing d3d9.dll"); + ERROR_LOG(G3D, "Missing d3d9.dll"); *error_message = "D3D9.dll missing - try reinstalling DirectX."; return false; } diff --git a/ext/native/profiler/profiler.cpp b/ext/native/profiler/profiler.cpp index 2c2457812f..60dffd5154 100644 --- a/ext/native/profiler/profiler.cpp +++ b/ext/native/profiler/profiler.cpp @@ -190,10 +190,7 @@ void internal_profiler_leave(int thread_id, int category) { void internal_profiler_end_frame() { int thread_id = internal_profiler_find_thread(); - if (profiler.depth[thread_id] != 0) { - // Threads may be off, but they'll fall into another frame. - FLOG("Can't be inside a profiler scope at end of frame!"); - } + _assert_msg_(profiler.depth[thread_id] == 0, "Can't be inside a profiler scope at end of frame!"); profiler.curFrameStart = real_time_now(); profiler.historyPos++; profiler.historyPos &= (HISTORY_SIZE - 1); diff --git a/ext/native/thin3d/GLRenderManager.cpp b/ext/native/thin3d/GLRenderManager.cpp index 7345e84fa1..19a3ac0053 100644 --- a/ext/native/thin3d/GLRenderManager.cpp +++ b/ext/native/thin3d/GLRenderManager.cpp @@ -114,7 +114,7 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) { renderThreadId = std::this_thread::get_id(); if (newInflightFrames_ != -1) { - ILOG("Updating inflight frames to %d", newInflightFrames_); + INFO_LOG(G3D, "Updating inflight frames to %d", newInflightFrames_); inflightFrames_ = newInflightFrames_; newInflightFrames_ = -1; } @@ -154,7 +154,7 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) { } void GLRenderManager::ThreadEnd() { - ILOG("ThreadEnd"); + INFO_LOG(G3D, "ThreadEnd"); // Wait for any shutdown to complete in StopThread(). std::unique_lock lock(mutex_); @@ -217,7 +217,7 @@ bool GLRenderManager::ThreadFrame() { } VLOG("PULL: Running frame %d", threadFrame_); if (firstFrame) { - ILOG("Running first frame (%d)", threadFrame_); + INFO_LOG(G3D, "Running first frame (%d)", threadFrame_); firstFrame = false; } Run(threadFrame_); @@ -246,7 +246,7 @@ void GLRenderManager::StopThread() { // Wait until we've definitely stopped the threadframe. std::unique_lock lock(mutex_); - ILOG("GL submission thread paused. Frame=%d", curFrame_); + INFO_LOG(G3D, "GL submission thread paused. Frame=%d", curFrame_); // Eat whatever has been queued up for this frame if anything. Wipe(); @@ -274,7 +274,7 @@ void GLRenderManager::StopThread() { } } } else { - ILOG("GL submission thread was already paused."); + INFO_LOG(G3D, "GL submission thread was already paused."); } } @@ -454,7 +454,7 @@ void GLRenderManager::BeginFrame() { // Must be after the fence - this performs deletes. VLOG("PUSH: BeginFrame %d", curFrame); if (!run_) { - WLOG("BeginFrame while !run_!"); + WARN_LOG(G3D, "BeginFrame while !run_!"); } // vulkan_->BeginFrame(); diff --git a/ext/native/thin3d/thin3d.cpp b/ext/native/thin3d/thin3d.cpp index 97b6fe9e0a..aabb1d818b 100644 --- a/ext/native/thin3d/thin3d.cpp +++ b/ext/native/thin3d/thin3d.cpp @@ -2,7 +2,6 @@ #include #include -#include "base/logging.h" #include "base/display.h" #include "thin3d/thin3d.h" #include "Common/Log.h" @@ -92,7 +91,7 @@ bool RefCountedObject::ReleaseAssertLast() { return true; } } else { - ELOG("Refcount (%d) invalid for object %p - corrupt?", refcount_, this); + ERROR_LOG(G3D, "Refcount (%d) invalid for object %p - corrupt?", refcount_, this); } return false; } diff --git a/ext/native/thin3d/thin3d.h b/ext/native/thin3d/thin3d.h index ced1d8df67..88001c4aa3 100644 --- a/ext/native/thin3d/thin3d.h +++ b/ext/native/thin3d/thin3d.h @@ -12,7 +12,6 @@ #include #include -#include "base/logging.h" #include "DataFormat.h" namespace Lin { diff --git a/ext/native/thin3d/thin3d_d3d11.cpp b/ext/native/thin3d/thin3d_d3d11.cpp index 8c53ffc7d8..9c371678e0 100644 --- a/ext/native/thin3d/thin3d_d3d11.cpp +++ b/ext/native/thin3d/thin3d_d3d11.cpp @@ -870,7 +870,7 @@ public: ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t dataSize, const std::string &tag) { if (language != ShaderLanguage::HLSL_D3D11) { - ELOG("Unsupported shader language"); + ERROR_LOG(G3D, "Unsupported shader language"); return nullptr; } @@ -915,7 +915,7 @@ ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLang } if (errorMsgs) { errors = std::string((const char *)errorMsgs->GetBufferPointer(), errorMsgs->GetBufferSize()); - ELOG("Failed compiling:\n%s\n%s", data, errors.c_str()); + ERROR_LOG(G3D, "Failed compiling:\n%s\n%s", data, errors.c_str()); errorMsgs->Release(); } @@ -940,7 +940,7 @@ ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLang result = device_->CreateGeometryShader(data, dataSize, nullptr, &module->gs); break; default: - ELOG("Unsupported shader stage"); + ERROR_LOG(G3D, "Unsupported shader stage"); result = S_FALSE; break; } diff --git a/ext/native/thin3d/thin3d_d3d9.cpp b/ext/native/thin3d/thin3d_d3d9.cpp index 0b6740963f..2b629149a8 100644 --- a/ext/native/thin3d/thin3d_d3d9.cpp +++ b/ext/native/thin3d/thin3d_d3d9.cpp @@ -33,11 +33,12 @@ #define D3DXERR_INVALIDDATA 0x88760b59 #endif -#include "base/logging.h" #include "math/lin/matrix4x4.h" #include "thin3d/thin3d.h" #include "gfx/d3d9_state.h" +#include "Common/Log.h" + namespace Draw { // Could be declared as u8 @@ -381,7 +382,7 @@ bool D3D9Texture::Create(const TextureDesc &desc) { break; } if (FAILED(hr)) { - ELOG("Texture creation failed"); + ERROR_LOG(G3D, "Texture creation failed"); return false; } @@ -476,7 +477,7 @@ void D3D9Texture::SetImageData(int x, int y, int z, int width, int height, int d } default: - ELOG("Non-LINEAR2D textures not yet supported"); + ERROR_LOG(G3D, "Non-LINEAR2D textures not yet supported"); break; } } @@ -636,7 +637,7 @@ private: D3D9Context::D3D9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapterId, IDirect3DDevice9 *device, IDirect3DDevice9Ex *deviceEx) : d3d_(d3d), d3dEx_(d3dEx), adapterId_(adapterId), device_(device), deviceEx_(deviceEx), caps_{} { if (FAILED(d3d->GetAdapterIdentifier(adapterId, 0, &identifier_))) { - ELOG("Failed to get adapter identifier: %d", adapterId); + ERROR_LOG(G3D, "Failed to get adapter identifier: %d", adapterId); } switch (identifier_.VendorId) { case 0x10DE: caps_.vendor = GPUVendor::VENDOR_NVIDIA; break; @@ -691,13 +692,13 @@ ShaderModule *D3D9Context::CreateShaderModule(ShaderStage stage, ShaderLanguage Pipeline *D3D9Context::CreateGraphicsPipeline(const PipelineDesc &desc) { if (!desc.shaders.size()) { - ELOG("Pipeline requires at least one shader"); + ERROR_LOG(G3D, "Pipeline requires at least one shader"); return NULL; } D3D9Pipeline *pipeline = new D3D9Pipeline(device_); for (auto iter : desc.shaders) { if (!iter) { - ELOG("NULL shader passed to CreateGraphicsPipeline"); + ERROR_LOG(G3D, "NULL shader passed to CreateGraphicsPipeline"); delete pipeline; return NULL; } @@ -856,7 +857,7 @@ D3D9InputLayout::D3D9InputLayout(LPDIRECT3DDEVICE9 device, const InputLayoutDesc HRESULT hr = device->CreateVertexDeclaration(elements, &decl_); if (FAILED(hr)) { - ELOG("Error creating vertex decl"); + ERROR_LOG(G3D, "Error creating vertex decl"); } delete[] elements; } @@ -900,8 +901,7 @@ inline void Transpose4x4(float out[16], const float in[16]) { } void D3D9Context::UpdateDynamicUniformBuffer(const void *ub, size_t size) { - if (size != curPipeline_->dynamicUniforms.uniformBufferSize) - Crash(); + _assert_(size == curPipeline_->dynamicUniforms.uniformBufferSize); for (auto &uniform : curPipeline_->dynamicUniforms.uniforms) { int count = 0; switch (uniform.type) { @@ -935,7 +935,7 @@ void D3D9Context::UpdateBuffer(Buffer *buffer, const uint8_t *data, size_t offse if (!size) return; if (offset + size > buf->maxSize_) { - ELOG("Can't SubData with bigger size than buffer was created with"); + ERROR_LOG(G3D, "Can't SubData with bigger size than buffer was created with"); return; } if (buf->vbuffer_) { @@ -1104,7 +1104,7 @@ Framebuffer *D3D9Context::CreateFramebuffer(const FramebufferDesc &desc) { HRESULT rtResult = device_->CreateTexture(fbo->width, fbo->height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &fbo->tex, NULL); if (FAILED(rtResult)) { - ELOG("Failed to create render target"); + ERROR_LOG(G3D, "Failed to create render target"); delete fbo; return NULL; } @@ -1120,7 +1120,7 @@ Framebuffer *D3D9Context::CreateFramebuffer(const FramebufferDesc &desc) { dsResult = device_->CreateDepthStencilSurface(fbo->width, fbo->height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, FALSE, &fbo->depthstencil, NULL); } if (FAILED(dsResult)) { - ELOG("Failed to create depth buffer"); + ERROR_LOG(G3D, "Failed to create depth buffer"); fbo->surf->Release(); fbo->tex->Release(); if (fbo->depthstenciltex) { @@ -1264,13 +1264,13 @@ DrawContext *T3DCreateDX9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapt #if PPSSPP_API(D3DX9) int d3dx_ver = LoadD3DX9Dynamic(); if (!d3dx_ver) { - ELOG("Failed to load D3DX9!"); + ERROR_LOG(G3D, "Failed to load D3DX9!"); return NULL; } #elif PPSSPP_API(D3D9_D3DCOMPILER) bool result = LoadD3DCompilerDynamic(); if (!result) { - ELOG("Failed to load D3DCompiler!"); + ERROR_LOG(G3D, "Failed to load D3DCompiler!"); return NULL; } #endif diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index b77a8fd4fd..c42b186b54 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -4,7 +4,6 @@ #include #include -#include "base/logging.h" #include "math/dataconv.h" #include "math/math_util.h" #include "math/lin/matrix4x4.h" @@ -230,7 +229,7 @@ GLuint ShaderStageToOpenGL(ShaderStage stage) { class OpenGLShaderModule : public ShaderModule { public: OpenGLShaderModule(GLRenderManager *render, ShaderStage stage, const std::string &tag) : render_(render), stage_(stage), tag_(tag) { - DLOG("Shader module created (%p)", this); + DEBUG_LOG(G3D, "Shader module created (%p)", this); glstage_ = ShaderStageToOpenGL(stage); } @@ -644,7 +643,7 @@ GLuint TypeToTarget(TextureType type) { #endif case TextureType::ARRAY2D: return GL_TEXTURE_2D_ARRAY; default: - ELOG("Bad texture type %d", (int)type); + ERROR_LOG(G3D, "Bad texture type %d", (int)type); return GL_NONE; } } @@ -957,15 +956,15 @@ void OpenGLContext::UpdateBuffer(Buffer *buffer, const uint8_t *data, size_t off Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) { if (!desc.shaders.size()) { - ELOG("Pipeline requires at least one shader"); + ERROR_LOG(G3D, "Pipeline requires at least one shader"); return nullptr; } if ((int)desc.prim >= (int)Primitive::PRIMITIVE_TYPE_COUNT) { - ELOG("Invalid primitive type"); + ERROR_LOG(G3D, "Invalid primitive type"); return nullptr; } if (!desc.depthStencil || !desc.blend || !desc.raster || !desc.inputLayout) { - ELOG("Incomplete prim desciption"); + ERROR_LOG(G3D, "Incomplete prim desciption"); return nullptr; } @@ -975,7 +974,7 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) { iter->AddRef(); pipeline->shaders.push_back(static_cast(iter)); } else { - ELOG("ERROR: Tried to create graphics pipeline with a null shader module"); + ERROR_LOG(G3D, "ERROR: Tried to create graphics pipeline with a null shader module"); delete pipeline; return nullptr; } @@ -997,7 +996,7 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) { pipeline->inputLayout->AddRef(); return pipeline; } else { - ELOG("Failed to create pipeline - shaders failed to link"); + ERROR_LOG(G3D, "Failed to create pipeline - shaders failed to link"); delete pipeline; return nullptr; } @@ -1059,11 +1058,11 @@ bool OpenGLPipeline::LinkShaders() { if (shader) { linkShaders.push_back(shader); } else { - ELOG("LinkShaders: Bad shader module"); + ERROR_LOG(G3D, "LinkShaders: Bad shader module"); return false; } } else { - ELOG("LinkShaders: Bad shader in module"); + ERROR_LOG(G3D, "LinkShaders: Bad shader in module"); return false; } } @@ -1213,7 +1212,7 @@ void OpenGLInputLayout::Compile(const InputLayoutDesc &desc) { break; case DataFormat::UNDEFINED: default: - ELOG("Thin3DGLVertexFormat: Invalid or unknown component type applied."); + ERROR_LOG(G3D, "Thin3DGLVertexFormat: Invalid or unknown component type applied."); break; } diff --git a/ext/native/thin3d/thin3d_vulkan.cpp b/ext/native/thin3d/thin3d_vulkan.cpp index 7c033aeed3..f6c4dc18b9 100644 --- a/ext/native/thin3d/thin3d_vulkan.cpp +++ b/ext/native/thin3d/thin3d_vulkan.cpp @@ -21,9 +21,6 @@ #include #include -#include "Core/Config.h" - -#include "base/logging.h" #include "base/display.h" #include "base/stringutil.h" #include "image/zim_load.h" @@ -32,10 +29,13 @@ #include "thin3d/thin3d.h" #include "thin3d/VulkanRenderManager.h" +#include "Common/Log.h" #include "Common/Vulkan/VulkanContext.h" #include "Common/Vulkan/VulkanImage.h" #include "Common/Vulkan/VulkanMemory.h" +#include "Core/Config.h" + // We use a simple descriptor set for all rendering: 1 sampler, 1 texture, 1 UBO binding point. // binding 0 - uniform data // binding 1 - sampler @@ -704,7 +704,7 @@ bool VKTexture::Create(VkCommandBuffer cmd, VulkanPushBuffer *push, const Textur // Zero-sized textures not allowed. _assert_(desc.width * desc.height * desc.depth > 0); // remember to set depth to 1! if (desc.width * desc.height * desc.depth <= 0) { - ELOG("Bad texture dimensions %dx%dx%d", desc.width, desc.height, desc.depth); + ERROR_LOG(G3D, "Bad texture dimensions %dx%dx%d", desc.width, desc.height, desc.depth); return false; } _assert_(push); @@ -727,7 +727,7 @@ bool VKTexture::Create(VkCommandBuffer cmd, VulkanPushBuffer *push, const Textur } if (!vkTex_->CreateDirect(cmd, alloc, width_, height_, mipLevels_, vulkanFormat, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, usageBits)) { - ELOG("Failed to create VulkanTexture: %dx%dx%d fmt %d, %d levels", width_, height_, depth_, (int)vulkanFormat, mipLevels_); + ERROR_LOG(G3D, "Failed to create VulkanTexture: %dx%dx%d fmt %d, %d levels", width_, height_, depth_, (int)vulkanFormat, mipLevels_); return false; } if (desc.initData.size()) { @@ -1038,7 +1038,7 @@ Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc) { for (auto &iter : desc.shaders) { VKShaderModule *vkshader = (VKShaderModule *)iter; if (!vkshader) { - ELOG("CreateGraphicsPipeline got passed a null shader"); + ERROR_LOG(G3D, "CreateGraphicsPipeline got passed a null shader"); return nullptr; } VkPipelineShaderStageCreateInfo &stage = stages[i++]; @@ -1100,7 +1100,7 @@ Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc) { VkPipeline pipelines[2]{}; VkResult result = vkCreateGraphicsPipelines(device_, pipelineCache_, 2, createInfo, nullptr, pipelines); if (result != VK_SUCCESS) { - ELOG("Failed to create graphics pipeline"); + ERROR_LOG(G3D, "Failed to create graphics pipeline"); delete pipeline; return nullptr; } @@ -1177,14 +1177,14 @@ Texture *VKContext::CreateTexture(const TextureDesc &desc) { VkCommandBuffer initCmd = renderManager_.GetInitCmd(); if (!push_ || !initCmd) { // Too early! Fail. - ELOG("Can't create textures before the first frame has started."); + ERROR_LOG(G3D, "Can't create textures before the first frame has started."); return nullptr; } VKTexture *tex = new VKTexture(vulkan_, initCmd, push_, desc); if (tex->Create(initCmd, push_, desc, allocator_)) { return tex; } else { - ELOG("Failed to create texture"); + ERROR_LOG(G3D, "Failed to create texture"); delete tex; return nullptr; } @@ -1271,7 +1271,7 @@ ShaderModule *VKContext::CreateShaderModule(ShaderStage stage, ShaderLanguage la if (shader->Compile(vulkan_, language, data, size)) { return shader; } else { - ELOG("Failed to compile shader: %s", (const char *)data); + ERROR_LOG(G3D, "Failed to compile shader: %s", (const char *)data); shader->Release(); return nullptr; } diff --git a/ext/native/thread/prioritizedworkqueue.cpp b/ext/native/thread/prioritizedworkqueue.cpp index 35a1e94a62..dcb233f38c 100644 --- a/ext/native/thread/prioritizedworkqueue.cpp +++ b/ext/native/thread/prioritizedworkqueue.cpp @@ -1,13 +1,14 @@ #include #include -#include "base/logging.h" #include "base/timeutil.h" #include "thread/prioritizedworkqueue.h" +#include "Common/Log.h" + PrioritizedWorkQueue::~PrioritizedWorkQueue() { if (!done_) { - ELOG("PrioritizedWorkQueue destroyed but not done!"); + ERROR_LOG(SYSTEM, "PrioritizedWorkQueue destroyed but not done!"); } } @@ -32,7 +33,7 @@ void PrioritizedWorkQueue::Flush() { } queue_.clear(); if (flush_count > 0) { - ILOG("PrioritizedWorkQueue: Flushed %d un-executed tasks", flush_count); + INFO_LOG(SYSTEM, "PrioritizedWorkQueue: Flushed %d un-executed tasks", flush_count); } } diff --git a/ext/native/thread/threadpool.cpp b/ext/native/thread/threadpool.cpp index a312748014..6f5a83d255 100644 --- a/ext/native/thread/threadpool.cpp +++ b/ext/native/thread/threadpool.cpp @@ -1,6 +1,7 @@ -#include "base/logging.h" #include "thread/threadpool.h" #include "thread/threadutil.h" + +#include "Common/Log.h" #include "Common/MakeUnique.h" ///////////////////////////// WorkerThread @@ -86,9 +87,9 @@ void LoopWorkerThread::WorkFunc() { ThreadPool::ThreadPool(int numThreads) { if (numThreads <= 0) { numThreads_ = 1; - ILOG("ThreadPool: Bad number of threads %i", numThreads); + INFO_LOG(JIT, "ThreadPool: Bad number of threads %d", numThreads); } else if (numThreads > 8) { - ILOG("ThreadPool: Capping number of threads to 8 (was %i)", numThreads); + INFO_LOG(JIT, "ThreadPool: Capping number of threads to 8 (was %d)", numThreads); numThreads_ = 8; } else { numThreads_ = numThreads; diff --git a/ext/native/thread/threadutil.cpp b/ext/native/thread/threadutil.cpp index 403f8cadd9..a47286b96f 100644 --- a/ext/native/thread/threadutil.cpp +++ b/ext/native/thread/threadutil.cpp @@ -8,10 +8,13 @@ #define TLS_SUPPORTED #endif +#include + #include "base/basictypes.h" -#include "base/logging.h" #include "thread/threadutil.h" +#include "Common/Log.h" + #if defined(__ANDROID__) || defined(__APPLE__) || (defined(__GLIBC__) && defined(_GNU_SOURCE)) #include #endif @@ -115,7 +118,7 @@ void setCurrentThreadName(const char* threadName) { void AssertCurrentThreadName(const char *threadName) { #ifdef TLS_SUPPORTED if (strcmp(curThreadName, threadName) != 0) { - ELOG("Thread name assert failed: Expected %s, was %s", threadName, curThreadName); + ERROR_LOG(SYSTEM, "Thread name assert failed: Expected %s, was %s", threadName, curThreadName); } #endif } diff --git a/ext/native/ui/root.cpp b/ext/native/ui/root.cpp index 460945204c..928d34dbfe 100644 --- a/ext/native/ui/root.cpp +++ b/ext/native/ui/root.cpp @@ -7,6 +7,8 @@ #include "ui/root.h" #include "ui/viewgroup.h" +#include "Common/Log.h" + namespace UI { static std::mutex focusLock; @@ -109,7 +111,7 @@ bool IsFocusMovementEnabled() { void LayoutViewHierarchy(const UIContext &dc, ViewGroup *root, bool ignoreInsets) { if (!root) { - ELOG("Tried to layout a view hierarchy from a zero pointer root"); + ERROR_LOG(SYSTEM, "Tried to layout a view hierarchy from a zero pointer root"); return; } @@ -358,7 +360,7 @@ void UpdateViewHierarchy(ViewGroup *root) { frameCount++; if (!root) { - ELOG("Tried to update a view hierarchy from a zero pointer root"); + ERROR_LOG(SYSTEM, "Tried to update a view hierarchy from a zero pointer root"); return; } diff --git a/ext/native/ui/screen.cpp b/ext/native/ui/screen.cpp index 3b99486d69..32a26196cc 100644 --- a/ext/native/ui/screen.cpp +++ b/ext/native/ui/screen.cpp @@ -1,5 +1,4 @@ #include "base/display.h" -#include "base/logging.h" #include "base/timeutil.h" #include "input/input_state.h" #include "ui/root.h" @@ -7,6 +6,8 @@ #include "ui/ui.h" #include "ui/view.h" +#include "Common/Log.h" + ScreenManager::ScreenManager() { uiContext_ = 0; dialogFinished_ = 0; @@ -18,7 +19,7 @@ ScreenManager::~ScreenManager() { void ScreenManager::switchScreen(Screen *screen) { if (!nextStack_.empty() && screen == nextStack_.front().screen) { - ELOG("Already switching to this screen"); + ERROR_LOG(SYSTEM, "Already switching to this screen"); return; } // Note that if a dialog is found, this will be a silent background switch that @@ -26,12 +27,12 @@ void ScreenManager::switchScreen(Screen *screen) { // until that switch. // TODO: is this still true? if (!nextStack_.empty()) { - ELOG("Already had a nextStack_! Asynchronous open while doing something? Deleting the new screen."); + ERROR_LOG(SYSTEM, "Already had a nextStack_! Asynchronous open while doing something? Deleting the new screen."); delete screen; return; } if (screen == nullptr) { - WLOG("Swiching to a zero screen, this can't be good"); + WARN_LOG(SYSTEM, "Switching to a zero screen, this can't be good"); } if (stack_.empty() || screen != stack_.back().screen) { screen->setScreenManager(this); @@ -53,7 +54,7 @@ void ScreenManager::update() { void ScreenManager::switchToNext() { std::lock_guard guard(inputLock_); if (nextStack_.empty()) { - ELOG("switchToNext: No nextStack_!"); + ERROR_LOG(SYSTEM, "switchToNext: No nextStack_!"); } Layer temp = {nullptr, 0}; @@ -128,7 +129,7 @@ void ScreenManager::deviceRestored() { } void ScreenManager::resized() { - ILOG("ScreenManager::resized(dp: %dx%d)", dp_xres, dp_yres); + INFO_LOG(SYSTEM, "ScreenManager::resized(dp: %dx%d)", dp_xres, dp_yres); std::lock_guard guard(inputLock_); // Have to notify the whole stack, otherwise there will be problems when going back // to non-top screens. @@ -143,7 +144,7 @@ void ScreenManager::render() { case LAYER_SIDEMENU: case LAYER_TRANSPARENT: if (stack_.size() == 1) { - ELOG("Can't have sidemenu over nothing"); + ERROR_LOG(SYSTEM, "Can't have sidemenu over nothing"); break; } else { auto iter = stack_.end(); @@ -170,7 +171,7 @@ void ScreenManager::render() { break; } } else { - ELOG("No current screen!"); + ERROR_LOG(SYSTEM, "No current screen!"); } processFinishDialog(); @@ -235,7 +236,7 @@ void ScreenManager::pop() { delete stack_.back().screen; stack_.pop_back(); } else { - ELOG("Can't pop when stack empty"); + ERROR_LOG(SYSTEM, "Can't pop when stack empty"); } } @@ -247,11 +248,11 @@ void ScreenManager::RecreateAllViews() { void ScreenManager::finishDialog(Screen *dialog, DialogResult result) { if (stack_.empty()) { - ELOG("Must be in a dialog to finishDialog"); + ERROR_LOG(SYSTEM, "Must be in a dialog to finishDialog"); return; } if (dialog != stack_.back().screen) { - ELOG("Wrong dialog being finished!"); + ERROR_LOG(SYSTEM, "Wrong dialog being finished!"); return; } dialog->onFinish(result); @@ -283,10 +284,10 @@ void ScreenManager::processFinishDialog() { } if (!caller) { - ELOG("ERROR: no top screen when finishing dialog"); + ERROR_LOG(SYSTEM, "ERROR: no top screen when finishing dialog"); } else if (caller != topScreen()) { // The caller may get confused if we call dialogFinished() now. - WLOG("Skipping non-top dialog when finishing dialog."); + WARN_LOG(SYSTEM, "Skipping non-top dialog when finishing dialog."); } else { caller->dialogFinished(dialogFinished_, dialogResult_); } diff --git a/ext/native/ui/ui_context.cpp b/ext/native/ui/ui_context.cpp index 22cc79c24b..c1dbfd4729 100644 --- a/ext/native/ui/ui_context.cpp +++ b/ext/native/ui/ui_context.cpp @@ -4,7 +4,6 @@ #include "base/display.h" #include "base/NativeApp.h" -#include "base/logging.h" #include "ui/ui.h" #include "ui/view.h" #include "ui/ui_context.h" diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index 180e271aae..ca36957b62 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -1,6 +1,7 @@ #include #include #include + #include "base/display.h" #include "base/stringutil.h" #include "input/input_state.h" @@ -13,6 +14,8 @@ #include "i18n/i18n.h" #include "gfx_es2/draw_buffer.h" +#include "Common/Log.h" + static const bool ClickDebug = false; UIScreen::UIScreen() @@ -137,11 +140,11 @@ TouchInput UIScreen::transformTouch(const TouchInput &touch) { bool UIScreen::touch(const TouchInput &touch) { if (root_) { if (ClickDebug && (touch.flags & TOUCH_DOWN)) { - ILOG("Touch down!"); + INFO_LOG(SYSTEM, "Touch down!"); std::vector views; root_->Query(touch.x, touch.y, views); for (auto view : views) { - ILOG("%s", view->Describe().c_str()); + INFO_LOG(SYSTEM, "%s", view->Describe().c_str()); } } @@ -166,7 +169,7 @@ bool UIDialogScreen::key(const KeyInput &key) { bool retval = UIScreen::key(key); if (!retval && (key.flags & KEY_DOWN) && UI::IsEscapeKey(key)) { if (finished_) { - ELOG("Screen already finished"); + ERROR_LOG(SYSTEM, "Screen already finished"); } else { finished_ = true; TriggerFinish(DR_BACK); diff --git a/ext/native/ui/viewgroup.cpp b/ext/native/ui/viewgroup.cpp index 82a74faad8..cf96bc8db3 100644 --- a/ext/native/ui/viewgroup.cpp +++ b/ext/native/ui/viewgroup.cpp @@ -2,7 +2,6 @@ #include #include -#include "base/logging.h" #include "base/stringutil.h" #include "base/timeutil.h" #include "input/keycodes.h" @@ -14,6 +13,8 @@ #include "ui/viewgroup.h" #include "gfx_es2/draw_buffer.h" +#include "Common/Log.h" + #include namespace UI { @@ -236,7 +237,7 @@ float GetDirectionScore(View *origin, View *destination, FocusDirection directio float horizOverlap = HorizontalOverlap(origin->GetBounds(), destination->GetBounds()); float vertOverlap = VerticalOverlap(origin->GetBounds(), destination->GetBounds()); if (horizOverlap == 1.0f && vertOverlap == 1.0f) { - ILOG("Contain overlap"); + INFO_LOG(SYSTEM, "Contain overlap"); return 0.0; } float originSize = 0.0f; @@ -273,7 +274,7 @@ float GetDirectionScore(View *origin, View *destination, FocusDirection directio break; case FOCUS_PREV: case FOCUS_NEXT: - ELOG("Invalid focus direction"); + ERROR_LOG(SYSTEM, "Invalid focus direction"); break; } @@ -1083,7 +1084,7 @@ void AnchorLayout::Layout() { GridLayout::GridLayout(GridLayoutSettings settings, LayoutParams *layoutParams) : ViewGroup(layoutParams), settings_(settings), numColumns_(1) { if (settings.orientation != ORIENT_HORIZONTAL) - ELOG("GridLayout: Vertical layouts not yet supported"); + ERROR_LOG(SYSTEM, "GridLayout: Vertical layouts not yet supported"); } void GridLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) { diff --git a/headless/WindowsHeadlessHost.cpp b/headless/WindowsHeadlessHost.cpp index 30a9f1b7b2..d52dfc4053 100644 --- a/headless/WindowsHeadlessHost.cpp +++ b/headless/WindowsHeadlessHost.cpp @@ -17,8 +17,10 @@ #include +#include "base/logging.h" // For OutputDebugStringUTF8 #include "headless/WindowsHeadlessHost.h" +#include "Common/Log.h" #include "Common/FileUtil.h" #include "Common/CommonWindows.h"