From 80e0f85332076c187b80d41fa8a640f5a9bc4309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 15 Aug 2020 16:25:50 +0200 Subject: [PATCH] Getting really close to getting rid of base/logging.h now. Qt buildfix --- Common/FakeCPUDetect.cpp | 1 - Common/LogManager.cpp | 4 ++ Common/XboxCPUDetect.cpp | 68 ---------------------------- Core/MIPS/fake/FakeJit.cpp | 1 - GPU/Common/VertexDecoderFake.cpp | 1 - Qt/QtMain.cpp | 30 ++++++------ SDL/SDLGLGraphicsContext.cpp | 2 +- SDL/SDLMain.cpp | 31 ++++++------- UI/NativeApp.cpp | 38 ++++++++-------- UWP/PPSSPP_UWPMain.cpp | 4 +- UWP/StorageFileLoader.cpp | 8 ++-- android/jni/Arm64EmitterTest.cpp | 25 +++++----- android/jni/ArmEmitterTest.cpp | 23 +++++----- android/jni/TestRunner.cpp | 18 ++++---- ext/native/base/logging.cpp | 2 +- ext/native/file/zip_read.cpp | 6 +-- ext/native/gfx_es2/draw_text_qt.cpp | 2 +- ext/native/gfx_es2/draw_text_uwp.cpp | 8 ++-- ext/native/tools/audiotool.cpp | 17 ------- ios/ViewController.mm | 7 +-- unittest/UnitTest.cpp | 16 +++---- 21 files changed, 113 insertions(+), 199 deletions(-) delete mode 100644 Common/XboxCPUDetect.cpp delete mode 100644 ext/native/tools/audiotool.cpp diff --git a/Common/FakeCPUDetect.cpp b/Common/FakeCPUDetect.cpp index 41251b698a..d314afe773 100644 --- a/Common/FakeCPUDetect.cpp +++ b/Common/FakeCPUDetect.cpp @@ -17,7 +17,6 @@ #include -#include "base/logging.h" #include "base/basictypes.h" #include "Common.h" #include "CPUDetect.h" diff --git a/Common/LogManager.cpp b/Common/LogManager.cpp index 3c4de05878..c1eef5d2fb 100644 --- a/Common/LogManager.cpp +++ b/Common/LogManager.cpp @@ -18,6 +18,7 @@ #include "ppsspp_config.h" #include +#include #include "util/text/utf8.h" #include "LogManager.h" @@ -46,6 +47,9 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char LogManager *instance = LogManager::GetInstance(); if (instance) { instance->Log(level, type, file, line, fmt, args); + } else { + // Fall back to printf if we're before the log manager has been initialized. + vprintf(fmt, args); } va_end(args); } diff --git a/Common/XboxCPUDetect.cpp b/Common/XboxCPUDetect.cpp deleted file mode 100644 index b9b502a71a..0000000000 --- a/Common/XboxCPUDetect.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - - -#include -#include "base/logging.h" -#include "base/basictypes.h" -#include "Common.h" -#include "CPUDetect.h" -#include "StringUtils.h" - -CPUInfo cpu_info; - -CPUInfo::CPUInfo() { - Detect(); -} - -// Detects the various cpu features -void CPUInfo::Detect() -{ - memset(this, 0, sizeof(*this)); - num_cores = 3; - strcpy(cpu_string, "Xenon"); - strcpy(brand_string, "Microsoft"); - - memset(cpu_string, 0, sizeof(cpu_string)); - - HTT = true; - logical_cpu_count = 2; -} - -// Turn the cpu info into a string we can show -std::string CPUInfo::Summarize() -{ - std::string sum; - if (num_cores == 1) - sum = StringFromFormat("%s, %i core", cpu_string, num_cores); - else - { - sum = StringFromFormat("%s, %i cores", cpu_string, num_cores); - if (HTT) sum += StringFromFormat(" (%i logical threads per physical core)", logical_cpu_count); - } - if (bSSE) sum += ", SSE"; - if (bSSE2) sum += ", SSE2"; - if (bSSE3) sum += ", SSE3"; - if (bSSSE3) sum += ", SSSE3"; - if (bSSE4_1) sum += ", SSE4.1"; - if (bSSE4_2) sum += ", SSE4.2"; - if (HTT) sum += ", HTT"; - if (bAVX) sum += ", AVX"; - if (bAES) sum += ", AES"; - if (bLongMode) sum += ", 64-bit support"; - return sum; -} \ No newline at end of file diff --git a/Core/MIPS/fake/FakeJit.cpp b/Core/MIPS/fake/FakeJit.cpp index 25e085c0ed..257005a429 100644 --- a/Core/MIPS/fake/FakeJit.cpp +++ b/Core/MIPS/fake/FakeJit.cpp @@ -15,7 +15,6 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "base/logging.h" #include "Common/Serialize/Serializer.h" #include "Core/Reporting.h" #include "Core/Config.h" diff --git a/GPU/Common/VertexDecoderFake.cpp b/GPU/Common/VertexDecoderFake.cpp index 1619b2ba0f..af27e69561 100644 --- a/GPU/Common/VertexDecoderFake.cpp +++ b/GPU/Common/VertexDecoderFake.cpp @@ -18,7 +18,6 @@ //TODO: Doesn't build, FIXME! #if 0 -#include "base/logging.h" #include "Common/CPUDetect.h" #include "Core/Config.h" #include "Core/Reporting.h" diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp index 7f9726b417..2ba3a2e630 100644 --- a/Qt/QtMain.cpp +++ b/Qt/QtMain.cpp @@ -71,23 +71,23 @@ static void InitSDLAudioDevice() { if (!g_Config.sAudioDevice.empty()) { audioDev = SDL_OpenAudioDevice(g_Config.sAudioDevice.c_str(), 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); if (audioDev <= 0) { - WLOG("Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str()); + WARN_LOG(AUDIO, "Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str()); } } if (audioDev <= 0) { audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); } if (audioDev <= 0) { - ELOG("Failed to open audio: %s", SDL_GetError()); + ERROR_LOG(AUDIO, "Failed to open audio: %s", SDL_GetError()); } else { if (g_retFmt.samples != fmt.samples) // Notify, but still use it - ELOG("Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples); + ERROR_LOG(AUDIO, "Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples); if (g_retFmt.format != fmt.format || g_retFmt.channels != fmt.channels) { - ELOG("Sound buffer format does not match requested format."); - ELOG("Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq); - ELOG("Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format); - ELOG("Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels); - ELOG("Provided output format does not match requirement, turning audio off"); + ERROR_LOG(AUDIO, "Sound buffer format does not match requested format."); + ERROR_LOG(AUDIO, "Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq); + ERROR_LOG(AUDIO, "Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format); + ERROR_LOG(AUDIO, "Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels); + ERROR_LOG(AUDIO, "Provided output format does not match requirement, turning audio off"); SDL_CloseAudioDevice(audioDev); } SDL_PauseAudioDevice(audioDev, 0); @@ -343,9 +343,9 @@ MainUI::MainUI(QWidget *parent) } MainUI::~MainUI() { - ILOG("MainUI::Destructor"); + INFO_LOG(SYSTEM, "MainUI::Destructor"); if (emuThreadState != (int)EmuThreadState::DISABLED) { - ILOG("EmuThreadStop"); + INFO_LOG(SYSTEM, "EmuThreadStop"); EmuThreadStop(); while (graphicsContext->ThreadFrame()) { // Need to keep eating frames to allow the EmuThread to exit correctly. @@ -525,7 +525,7 @@ bool MainUI::event(QEvent *e) { void MainUI::initializeGL() { if (g_Config.iGPUBackend != (int)GPUBackend::OPENGL) { - ILOG("Only GL supported under Qt - switching."); + INFO_LOG(SYSTEM, "Only GL supported under Qt - switching."); g_Config.iGPUBackend = (int)GPUBackend::OPENGL; } @@ -545,12 +545,12 @@ void MainUI::initializeGL() { #endif if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL) { // OpenGL uses a background thread to do the main processing and only renders on the gl thread. - ILOG("Initializing GL graphics context"); + INFO_LOG(SYSTEM, "Initializing GL graphics context"); graphicsContext = new QtGLGraphicsContext(); - ILOG("Using thread, starting emu thread"); + INFO_LOG(SYSTEM, "Using thread, starting emu thread"); EmuThreadStart(); } else { - ILOG("Not using thread, backend=%d", (int)g_Config.iGPUBackend); + INFO_LOG(SYSTEM, "Not using thread, backend=%d", (int)g_Config.iGPUBackend); } graphicsContext->ThreadStart(); } @@ -714,7 +714,7 @@ int main(int argc, char *argv[]) g_Config.iGPUBackend = (int)GPUBackend::OPENGL; int ret = mainInternal(a); - ILOG("Left mainInternal here."); + INFO_LOG(SYSTEM, "Left mainInternal here."); #ifdef SDL if (audioDev > 0) { diff --git a/SDL/SDLGLGraphicsContext.cpp b/SDL/SDLGLGraphicsContext.cpp index 772f5c764f..e99c15ed75 100644 --- a/SDL/SDLGLGraphicsContext.cpp +++ b/SDL/SDLGLGraphicsContext.cpp @@ -425,7 +425,7 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, std: }); renderManager_->SetSwapIntervalFunction([&](int interval) { - ILOG("SDL SwapInterval: %d", interval); + INFO_LOG(G3D, "SDL SwapInterval: %d", interval); SDL_GL_SetSwapInterval(interval); }); window_ = window; diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index f385475e66..6c882b5681 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -22,7 +22,6 @@ SDLJoystick *joystick = NULL; #include #include "base/display.h" -#include "base/logging.h" // early logging. TODO: Remove. #include "base/timeutil.h" #include "ext/glslang/glslang/Public/ShaderLang.h" #include "image/png_load.h" @@ -110,24 +109,24 @@ static void InitSDLAudioDevice(const std::string &name = "") { if (!startDevice.empty()) { audioDev = SDL_OpenAudioDevice(startDevice.c_str(), 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); if (audioDev <= 0) { - WLOG("Failed to open audio device: %s", startDevice.c_str()); + WARN_LOG(AUDIO, "Failed to open audio device: %s", startDevice.c_str()); } } if (audioDev <= 0) { - ILOG("SDL: Trying a different audio device"); + INFO_LOG(AUDIO, "SDL: Trying a different audio device"); audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); } if (audioDev <= 0) { - ELOG("Failed to open audio device: %s", SDL_GetError()); + ERROR_LOG(AUDIO, "Failed to open audio device: %s", SDL_GetError()); } else { if (g_retFmt.samples != fmt.samples) // Notify, but still use it - ELOG("Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples); + ERROR_LOG(AUDIO, "Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples); if (g_retFmt.format != fmt.format || g_retFmt.channels != fmt.channels) { - ELOG("Sound buffer format does not match requested format."); - ELOG("Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq); - ELOG("Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format); - ELOG("Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels); - ELOG("Provided output format does not match requirement, turning audio off"); + ERROR_LOG(AUDIO, "Sound buffer format does not match requested format."); + ERROR_LOG(AUDIO, "Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq); + ERROR_LOG(AUDIO, "Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format); + ERROR_LOG(AUDIO, "Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels); + ERROR_LOG(AUDIO, "Provided output format does not match requirement, turning audio off"); SDL_CloseAudioDevice(audioDev); } SDL_PauseAudioDevice(audioDev, 0); @@ -206,7 +205,7 @@ void LaunchBrowser(const char *url) { webWifiCreate(&conf, NULL, url, uuid, 0); webWifiShow(&conf, NULL); #elif defined(MOBILE_DEVICE) - ILOG("Would have gone to %s but LaunchBrowser is not implemented on this platform", url); + INFO_LOG(SYSTEM, "Would have gone to %s but LaunchBrowser is not implemented on this platform", url); #elif defined(_WIN32) std::wstring wurl = ConvertUTF8ToWString(url); ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL); @@ -217,7 +216,7 @@ void LaunchBrowser(const char *url) { std::string command = std::string("xdg-open ") + url; int err = system(command.c_str()); if (err) { - ILOG("Would have gone to %s but xdg-utils seems not to be installed", url) + INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url); } #endif } @@ -229,7 +228,7 @@ void LaunchMarket(const char *url) { webWifiCreate(&conf, NULL, url, uuid, 0); webWifiShow(&conf, NULL); #elif defined(MOBILE_DEVICE) - ILOG("Would have gone to %s but LaunchMarket is not implemented on this platform", url); + INFO_LOG(SYSTEM, "Would have gone to %s but LaunchMarket is not implemented on this platform", url); #elif defined(_WIN32) std::wstring wurl = ConvertUTF8ToWString(url); ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL); @@ -240,14 +239,14 @@ void LaunchMarket(const char *url) { std::string command = std::string("xdg-open ") + url; int err = system(command.c_str()); if (err) { - ILOG("Would have gone to %s but xdg-utils seems not to be installed", url) + INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url); } #endif } void LaunchEmail(const char *email_address) { #if defined(MOBILE_DEVICE) - ILOG("Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address); + INFO_LOG(SYSTEM, "Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address); #elif defined(_WIN32) std::wstring mailto = std::wstring(L"mailto:") + ConvertUTF8ToWString(email_address); ShellExecute(NULL, L"open", mailto.c_str(), NULL, NULL, SW_SHOWNORMAL); @@ -258,7 +257,7 @@ void LaunchEmail(const char *email_address) { std::string command = std::string("xdg-email ") + email_address; int err = system(command.c_str()); if (err) { - ILOG("Would have gone to %s but xdg-utils seems not to be installed", email_address) + INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", email_address); } #endif } diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 919d7ce2f6..4c3559d030 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -237,7 +237,7 @@ void QtHost::ShutdownSound() { } std::string NativeQueryConfig(std::string query) { char temp[128]; if (query == "screenRotation") { - ILOG("g_Config.screenRotation = %d", g_Config.iScreenRotation); + INFO_LOG(G3D, "g_Config.screenRotation = %d", g_Config.iScreenRotation); snprintf(temp, sizeof(temp), "%d", g_Config.iScreenRotation); return std::string(temp); } else if (query == "immersiveMode") { @@ -357,7 +357,7 @@ static void PostLoadConfig() { void CreateDirectoriesAndroid() { // On Android, create a PSP directory tree in the external_dir, // to hopefully reduce confusion a bit. - ILOG("Creating %s", (g_Config.memStickDirectory + "PSP").c_str()); + INFO_LOG(IO, "Creating %s", (g_Config.memStickDirectory + "PSP").c_str()); File::CreateFullPath(g_Config.memStickDirectory + "PSP"); File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVEDATA)); File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVESTATE)); @@ -608,21 +608,21 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch // don't already have one. if (!gotBootFilename) { gotBootFilename = true; - ILOG("Boot filename found in args: '%s'", argv[i]); + INFO_LOG(SYSTEM, "Boot filename found in args: '%s'", argv[i]); bool okToLoad = true; bool okToCheck = true; if (System_GetPropertyBool(SYSPROP_SUPPORTS_PERMISSIONS)) { PermissionStatus status = System_GetPermissionStatus(SYSTEM_PERMISSION_STORAGE); if (status == PERMISSION_STATUS_DENIED) { - ELOG("Storage permission denied. Launching without argument."); + ERROR_LOG(IO, "Storage permission denied. Launching without argument."); okToLoad = false; okToCheck = false; } else if (status != PERMISSION_STATUS_GRANTED) { - ELOG("Storage permission not granted. Launching without argument check."); + ERROR_LOG(IO, "Storage permission not granted. Launching without argument check."); okToCheck = false; } else { - ILOG("Storage permission granted."); + INFO_LOG(IO, "Storage permission granted."); } } if (okToLoad) { @@ -812,7 +812,7 @@ void RenderOverlays(UIContext *dc, void *userdata); bool CreateGlobalPipelines(); bool NativeInitGraphics(GraphicsContext *graphicsContext) { - ILOG("NativeInitGraphics"); + INFO_LOG(SYSTEM, "NativeInitGraphics"); // We set this now so any resize during init is processed later. resized = false; @@ -881,7 +881,7 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) { gpu->DeviceRestore(); } - ILOG("NativeInitGraphics completed"); + INFO_LOG(SYSTEM, "NativeInitGraphics completed"); return true; } @@ -931,7 +931,7 @@ void NativeShutdownGraphics() { if (gpu) gpu->DeviceLost(); - ILOG("NativeShutdownGraphics"); + INFO_LOG(SYSTEM, "NativeShutdownGraphics"); #if PPSSPP_PLATFORM(WINDOWS) delete winAudioBackend; @@ -973,7 +973,7 @@ void NativeShutdownGraphics() { texColorPipeline = nullptr; } - ILOG("NativeShutdownGraphics done"); + INFO_LOG(SYSTEM, "NativeShutdownGraphics done"); } void TakeScreenshot() { @@ -1090,7 +1090,7 @@ void NativeRender(GraphicsContext *graphicsContext) { } if (resized) { - ILOG("Resized flag set - recalculating bounds"); + INFO_LOG(G3D, "Resized flag set - recalculating bounds"); resized = false; if (uiContext) { @@ -1119,7 +1119,7 @@ void NativeRender(GraphicsContext *graphicsContext) { NativeMessageReceived("gpu_resized", ""); #endif } else { - // ILOG("Polling graphics context"); + // INFO_LOG(G3D, "Polling graphics context"); graphicsContext->Poll(); } @@ -1179,7 +1179,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) { // Ideally we should simply reinitialize graphics to the mode from the config, but there are potential issues // and I can't risk it before 1.9.0. int gpuBackend = g_Config.iGPUBackend; - ILOG("Reloading config after storage permission grant."); + INFO_LOG(IO, "Reloading config after storage permission grant."); g_Config.Reload(); PostLoadConfig(); g_Config.iGPUBackend = gpuBackend; @@ -1218,16 +1218,16 @@ void NativeUpdate() { bool NativeIsAtTopLevel() { // This might need some synchronization? if (!screenManager) { - ELOG("No screen manager active"); + ERROR_LOG(SYSTEM, "No screen manager active"); return false; } Screen *currentScreen = screenManager->topScreen(); if (currentScreen) { bool top = currentScreen->isTopLevel(); - ILOG("Screen toplevel: %i", (int)top); + INFO_LOG(SYSTEM, "Screen toplevel: %i", (int)top); return currentScreen->isTopLevel(); } else { - ELOG("No current screen"); + ERROR_LOG(SYSTEM, "No current screen"); return false; } } @@ -1246,7 +1246,7 @@ bool NativeTouch(const TouchInput &touch) { } bool NativeKey(const KeyInput &key) { - // ILOG("Key code: %i flags: %i", key.keyCode, key.flags); + // INFO_LOG(SYSTEM, "Key code: %i flags: %i", key.keyCode, key.flags); #if !defined(MOBILE_DEVICE) if (g_Config.bPauseExitsEmulator) { static std::vector pspKeys; @@ -1364,7 +1364,7 @@ void NativeInputBoxReceived(std::function cb, b void NativeResized() { // NativeResized can come from any thread so we just set a flag, then process it later. - ILOG("NativeResized - setting flag"); + INFO_LOG(G3D, "NativeResized - setting flag"); resized = true; } @@ -1398,7 +1398,7 @@ void NativeShutdown() { moncleanup(); #endif - ILOG("NativeShutdown called"); + INFO_LOG(SYSTEM, "NativeShutdown called"); ShutdownWebServer(); diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index 24f3b964d1..07a136c69f 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -505,7 +505,7 @@ std::string GetCPUBrandString() { } catch (const std::exception & e) { const char* what = e.what(); - ILOG("%s", what); + INFO_LOG(SYSTEM, "%s", what); } if (cpu_id != nullptr) { @@ -527,7 +527,7 @@ std::string GetCPUBrandString() { } catch (const std::exception & e) { const char* what = e.what(); - ILOG("%s", what); + INFO_LOG(SYSTEM, "%s", what); } } diff --git a/UWP/StorageFileLoader.cpp b/UWP/StorageFileLoader.cpp index 0c52448a58..da0f6af19e 100644 --- a/UWP/StorageFileLoader.cpp +++ b/UWP/StorageFileLoader.cpp @@ -43,7 +43,7 @@ void StorageFileLoader::threadfunc() { operationFailed_ = true; // TODO: What do we do? const char *what = e.what(); - ILOG("%s", what); + INFO_LOG(SYSTEM, "%s", what); } catch (Platform::COMException ^e) { @@ -57,11 +57,11 @@ void StorageFileLoader::threadfunc() { } catch (const std::exception& e) { const char *what = e.what(); - ILOG("%s", what); + INFO_LOG(SYSTEM, "%s", what); } catch (Platform::COMException ^e) { std::string what = FromPlatformString(e->ToString()); - ILOG("%s", what.c_str()); + INFO_LOG(SYSTEM, "%s", what.c_str()); } initMutex.unlock(); @@ -85,7 +85,7 @@ void StorageFileLoader::threadfunc() { } catch (const std::exception& e) { operationFailed_ = true; const char *what = e.what(); - ILOG("%s", what); + INFO_LOG(SYSTEM, "%s", what); } operationRequested_ = false; std::unique_lock lock(mutexResponse_); diff --git a/android/jni/Arm64EmitterTest.cpp b/android/jni/Arm64EmitterTest.cpp index e14c98532d..3a04f6fb18 100644 --- a/android/jni/Arm64EmitterTest.cpp +++ b/android/jni/Arm64EmitterTest.cpp @@ -1,8 +1,7 @@ -#include "base/logging.h" - #include "Common/Arm64Emitter.h" #include "Common/BitSet.h" #include "Common/CPUDetect.h" +#include "Common/Log.h" static bool functionWasCalled; @@ -67,11 +66,11 @@ void Arm64EmitterTest() { return; for (int i = 0; i < 6; i++) { - ILOG("---------------------------"); + INFO_LOG(SYSTEM, "---------------------------"); } - ILOG("---------------------------"); - ILOG("Running ARM64 emitter test!"); - ILOG("---------------------------"); + INFO_LOG(SYSTEM, "---------------------------"); + INFO_LOG(SYSTEM, "Running ARM64 emitter test!"); + INFO_LOG(SYSTEM, "---------------------------"); TestCode gen; gen.ReserveCodeSpace(0x1000); @@ -79,15 +78,15 @@ void Arm64EmitterTest() { gen.Generate(); u32 retval = CallPtr(gen.testCodePtr); - ILOG("Returned %d", retval); - // ILOG("ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval); + INFO_LOG(SYSTEM, "Returned %d", retval); + // INFO_LOG(SYSTEM, "ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval); /* - ILOG("x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]); - ILOG("y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]); - ILOG("z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]); - ILOG("c: %f %f %f %f", c[0], c[1], c[2], c[3]);*/ + INFO_LOG(SYSTEM, "x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]); + INFO_LOG(SYSTEM, "y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]); + INFO_LOG(SYSTEM, "z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]); + INFO_LOG(SYSTEM, "c: %f %f %f %f", c[0], c[1], c[2], c[3]);*/ for (int i = 0; i < 6; i++) { - ILOG("--------------------------"); + INFO_LOG(SYSTEM, "--------------------------"); } // DisassembleArm(codeStart, gen.GetCodePtr()-codeStart); } diff --git a/android/jni/ArmEmitterTest.cpp b/android/jni/ArmEmitterTest.cpp index 8090c1e94c..5af9643f07 100644 --- a/android/jni/ArmEmitterTest.cpp +++ b/android/jni/ArmEmitterTest.cpp @@ -1,4 +1,3 @@ -#include "base/logging.h" #include "ArmEmitterTest.h" #include "Common/ArmEmitter.h" @@ -70,7 +69,7 @@ void TestCode::Generate() VST1(I_32, D6, R3, 2); PLD(R1, 32); u32 word = *(u32 *)(GetCodePtr() - 4); - ILOG("Instruction Word: %08x", word); + INFO_LOG(SYSTEM, "Instruction Word: %08x", word); // This works! @@ -122,11 +121,11 @@ void ArmEmitterTest() return; for (int i = 0; i < 6; i++) { - ILOG("--------------------------"); + INFO_LOG(SYSTEM, "--------------------------"); } - ILOG("--------------------------"); - ILOG("Running ARM emitter test!"); - ILOG("--------------------------"); + INFO_LOG(SYSTEM, "--------------------------"); + INFO_LOG(SYSTEM, "Running ARM emitter test!"); + INFO_LOG(SYSTEM, "--------------------------"); TestCode gen; gen.ReserveCodeSpace(0x1000); @@ -134,13 +133,13 @@ void ArmEmitterTest() gen.Generate(); u32 retval = CallPtr(gen.testCodePtr); - // ILOG("ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval); - ILOG("x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]); - ILOG("y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]); - ILOG("z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]); - ILOG("c: %f %f %f %f", c[0], c[1], c[2], c[3]); + // INFO_LOG(SYSTEM, "ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval); + INFO_LOG(SYSTEM, "x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]); + INFO_LOG(SYSTEM, "y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]); + INFO_LOG(SYSTEM, "z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]); + INFO_LOG(SYSTEM, "c: %f %f %f %f", c[0], c[1], c[2], c[3]); for (int i = 0; i < 6; i++) { - ILOG("--------------------------"); + INFO_LOG(SYSTEM, "--------------------------"); } // DisassembleArm(codeStart, gen.GetCodePtr()-codeStart); } diff --git a/android/jni/TestRunner.cpp b/android/jni/TestRunner.cpp index 2a24811289..f3db153a6e 100644 --- a/android/jni/TestRunner.cpp +++ b/android/jni/TestRunner.cpp @@ -28,9 +28,9 @@ #include "ppsspp_config.h" #include "base/basictypes.h" #include "base/display.h" -#include "base/logging.h" #include "Common/FileUtil.h" +#include "Common/Log.h" #include "Core/Core.h" #include "Core/System.h" #include "Core/Config.h" @@ -112,11 +112,11 @@ bool RunTests() { coreParam.fileToStart = baseDirectory + "pspautotests/tests/" + testName + ".prx"; std::string expectedFile = baseDirectory + "pspautotests/tests/" + testName + ".expected"; - ILOG("Preparing to execute '%s'", testName); + INFO_LOG(SYSTEM, "Preparing to execute '%s'", testName); std::string error_string; output = ""; if (!PSP_Init(coreParam, &error_string)) { - ELOG("Failed to init unittest %s : %s", testsToRun[i], error_string.c_str()); + ERROR_LOG(SYSTEM, "Failed to init unittest %s : %s", testsToRun[i], error_string.c_str()); PSP_CoreParameter().pixelWidth = pixel_xres; PSP_CoreParameter().pixelHeight = pixel_yres; return false; @@ -125,7 +125,7 @@ bool RunTests() { PSP_BeginHostFrame(); // Run the emu until the test exits - ILOG("Test: Entering runloop."); + INFO_LOG(SYSTEM, "Test: Entering runloop."); while (true) { int blockTicks = usToCycles(1000000 / 10); while (coreState == CORE_RUNNING) { @@ -136,7 +136,7 @@ bool RunTests() { // set back to running for the next frame coreState = CORE_RUNNING; } else if (coreState == CORE_POWERDOWN) { - ILOG("Finished running test %s", testName); + INFO_LOG(SYSTEM, "Finished running test %s", testName); break; } } @@ -144,7 +144,7 @@ bool RunTests() { std::ifstream expected(expectedFile.c_str(), std::ios_base::in); if (!expected) { - ELOG("Error opening expectedFile %s", expectedFile.c_str()); + ERROR_LOG(SYSTEM, "Error opening expectedFile %s", expectedFile.c_str()); break; } @@ -160,9 +160,9 @@ bool RunTests() { e = TrimNewlines(e); o = TrimNewlines(o); if (e != o) { - ELOG("DIFF on line %i!", line); - ELOG("O: %s", o.c_str()); - ELOG("E: %s", e.c_str()); + ERROR_LOG(SYSTEM, "DIFF on line %i!", line); + ERROR_LOG(SYSTEM, "O: %s", o.c_str()); + ERROR_LOG(SYSTEM, "E: %s", e.c_str()); } if (expected.eof()) { break; diff --git a/ext/native/base/logging.cpp b/ext/native/base/logging.cpp index b4f40fa8c7..812219d11f 100644 --- a/ext/native/base/logging.cpp +++ b/ext/native/base/logging.cpp @@ -1,4 +1,4 @@ -#include "base/logging.h" +#include const char *GetFn(const char *fn) { const char *p = strrchr(fn, '\\'); diff --git a/ext/native/file/zip_read.cpp b/ext/native/file/zip_read.cpp index b6e997877b..7efcab7255 100644 --- a/ext/native/file/zip_read.cpp +++ b/ext/native/file/zip_read.cpp @@ -301,7 +301,7 @@ uint8_t *VFSReadFile(const char *filename, size_t *size) { if (prefix_len >= fn_len) continue; if (0 == memcmp(filename, entries[i].prefix, prefix_len)) { fileSystemFound = true; - // ILOG("Prefix match: %s (%s) -> %s", entries[i].prefix, filename, filename + prefix_len); + // INFO_LOG(IO, "Prefix match: %s (%s) -> %s", entries[i].prefix, filename, filename + prefix_len); uint8_t *data = entries[i].reader->ReadAsset(filename + prefix_len, size); if (data) return data; @@ -319,7 +319,7 @@ uint8_t *VFSReadFile(const char *filename, size_t *size) { bool VFSGetFileListing(const char *path, std::vector *listing, const char *filter) { if (IsLocalPath(path)) { // Local path, not VFS. - // ILOG("Not a VFS path: %s . Reading local directory.", path); + // INFO_LOG(IO, "Not a VFS path: %s . Reading local directory.", path); getFilesInDir(path, listing, filter); return true; } @@ -346,7 +346,7 @@ bool VFSGetFileListing(const char *path, std::vector *listing, const c bool VFSGetFileInfo(const char *path, FileInfo *info) { if (IsLocalPath(path)) { // Local path, not VFS. - // ILOG("Not a VFS path: %s . Getting local file info.", path); + // INFO_LOG(IO, "Not a VFS path: %s . Getting local file info.", path); return getFileInfo(path, info); } diff --git a/ext/native/gfx_es2/draw_text_qt.cpp b/ext/native/gfx_es2/draw_text_qt.cpp index 12929e25cf..39b4ac95eb 100644 --- a/ext/native/gfx_es2/draw_text_qt.cpp +++ b/ext/native/gfx_es2/draw_text_qt.cpp @@ -134,7 +134,7 @@ void TextDrawerQt::DrawStringBitmap(std::vector &bitmapData, TextString } } } else { - _assert_msg_("Bad TextDrawer format"); + _assert_msg_(false, "Bad TextDrawer format"); } } diff --git a/ext/native/gfx_es2/draw_text_uwp.cpp b/ext/native/gfx_es2/draw_text_uwp.cpp index a8c67d211b..9c3d9c21be 100644 --- a/ext/native/gfx_es2/draw_text_uwp.cpp +++ b/ext/native/gfx_es2/draw_text_uwp.cpp @@ -91,15 +91,15 @@ TextDrawerUWP::TextDrawerUWP(Draw::DrawContext *draw) : TextDrawer(draw), ctx_(n // Create D2D Device and DeviceContext. // TODO: We have one sitting right in DX::DeviceResource, there might be a way to use that instead. hr = m_d2dFactory->CreateDevice(dxgiDevice, &m_d2dDevice); - if (FAILED(hr)) FLOG("D2D CreateDevice failed"); + if (FAILED(hr)) _assert_msg_(false, "D2D CreateDevice failed"); hr = m_d2dDevice->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &m_d2dContext); - if (FAILED(hr)) FLOG("D2D CreateDeviceContext failed"); + if (FAILED(hr)) _assert_msg_(false, "D2D CreateDeviceContext failed"); // Load the Roboto font hr = m_dwriteFactory->CreateFontFileReference(L"Content/Roboto-Condensed.ttf", nullptr, &m_fontFile); - if (FAILED(hr)) ELOG("CreateFontFileReference failed"); + if (FAILED(hr)) ERROR_LOG(SYSTEM, "CreateFontFileReference failed"); hr = m_dwriteFactory->CreateFontSetBuilder(&m_fontSetBuilder); - if (FAILED(hr)) ELOG("CreateFontSetBuilder failed"); + if (FAILED(hr)) ERROR_LOG(SYSTEM, "CreateFontSetBuilder failed"); hr = m_fontSetBuilder->AddFontFile(m_fontFile); hr = m_fontSetBuilder->CreateFontSet(&m_fontSet); hr = m_dwriteFactory->CreateFontCollectionFromFontSet(m_fontSet, &m_fontCollection); diff --git a/ext/native/tools/audiotool.cpp b/ext/native/tools/audiotool.cpp deleted file mode 100644 index 68cfee7ae3..0000000000 --- a/ext/native/tools/audiotool.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// TODO - -#include - -#include "audio/wav_load.h" -#include "base/logging.h" - - -struct AudioClip { - int length; - -}; - - -int main(int argc, char **argv) { - CHECK(argc == 3); -} diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 4f6f9a4db3..4741c4373e 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -30,6 +30,7 @@ #include "Core/HLE/sceUsbCam.h" #include "Core/HLE/sceUsbGps.h" #include "Common/GraphicsContext.h" +#include "Common/Log.h" #include #include @@ -244,7 +245,7 @@ static LocationHelper *locationHelper; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ NativeInitGraphics(graphicsContext); - ILOG("Emulation thread starting\n"); + INFO_LOG(SYSTEM, "Emulation thread starting\n"); while (threadEnabled) { NativeUpdate(); NativeRender(graphicsContext); @@ -252,11 +253,11 @@ static LocationHelper *locationHelper; } - ILOG("Emulation thread shutting down\n"); + INFO_LOG(SYSTEM, "Emulation thread shutting down\n"); NativeShutdownGraphics(); // Also ask the main thread to stop, so it doesn't hang waiting for a new frame. - ILOG("Emulation thread stopping\n"); + INFO_LOG(SYSTEM, "Emulation thread stopping\n"); graphicsContext->StopThread(); threadStopped = true; diff --git a/unittest/UnitTest.cpp b/unittest/UnitTest.cpp index e2b94af96a..b8af6ae8bb 100644 --- a/unittest/UnitTest.cpp +++ b/unittest/UnitTest.cpp @@ -32,7 +32,6 @@ #include #include "base/NativeApp.h" -#include "base/logging.h" #include "input/input_state.h" #include "ext/disarm.h" #include "math/math_util.h" @@ -41,6 +40,7 @@ #include "Common/ArmEmitter.h" #include "Common/BitScan.h" #include "Common/CPUDetect.h" +#include "Common/Log.h" #include "Core/Config.h" #include "Core/FileSystems/ISOFileSystem.h" #include "Core/MemMap.h" @@ -326,7 +326,7 @@ bool TestMatrixTranspose() { } void TestGetMatrix(int matrix, MatrixSize sz) { - ILOG("Testing matrix %s", GetMatrixNotation(matrix, sz)); + INFO_LOG(SYSTEM, "Testing matrix %s", GetMatrixNotation(matrix, sz)); u8 fullMatrix[16]; u8 cols[4]; @@ -344,8 +344,8 @@ void TestGetMatrix(int matrix, MatrixSize sz) { // int rowName = GetRowName(matrix, sz, i, 0); int colName = cols[i]; int rowName = rows[i]; - ILOG("Column %i: %s", i, GetVectorNotation(colName, vsz)); - ILOG("Row %i: %s", i, GetVectorNotation(rowName, vsz)); + INFO_LOG(SYSTEM, "Column %i: %s", i, GetVectorNotation(colName, vsz)); + INFO_LOG(SYSTEM, "Row %i: %s", i, GetVectorNotation(rowName, vsz)); u8 colRegs[4]; u8 rowRegs[4]; @@ -366,12 +366,12 @@ void TestGetMatrix(int matrix, MatrixSize sz) { c << (int)fullMatrix[j * 4 + i] << " "; d << (int)rowRegs[j] << " "; } - ILOG("Col: %s vs %s", a.str().c_str(), b.str().c_str()); + INFO_LOG(SYSTEM, "Col: %s vs %s", a.str().c_str(), b.str().c_str()); if (a.str() != b.str()) - ILOG("WRONG!"); - ILOG("Row: %s vs %s", c.str().c_str(), d.str().c_str()); + INFO_LOG(SYSTEM, "WRONG!"); + INFO_LOG(SYSTEM, "Row: %s vs %s", c.str().c_str(), d.str().c_str()); if (c.str() != d.str()) - ILOG("WRONG!"); + INFO_LOG(SYSTEM, "WRONG!"); } }