diff --git a/Common/Log.h b/Common/Log.h index 481795bde2..8dc232319c 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -189,3 +189,6 @@ void AndroidAssertLog(const char *func, const char *file, int line, const char * } #endif // __ANDROID__ + +// Just INFO_LOGs on nonWindows. On Windows it outputs to the VS output console. +void OutputDebugStringUTF8(const char *p); diff --git a/Common/LogManager.cpp b/Common/LogManager.cpp index f16971c70c..3c4de05878 100644 --- a/Common/LogManager.cpp +++ b/Common/LogManager.cpp @@ -19,7 +19,6 @@ #include -#include "base/logging.h" #include "util/text/utf8.h" #include "LogManager.h" #include "ConsoleListener.h" @@ -325,3 +324,24 @@ void RingbufferLogListener::Log(const LogMessage &message) { curMessage_ -= MAX_LOGS; count_++; } + +#ifdef _WIN32 + +void OutputDebugStringUTF8(const char *p) { + wchar_t temp[4096]; + + int len = std::min(4095, (int)strlen(p)); + int size = (int)MultiByteToWideChar(CP_UTF8, 0, p, len, NULL, 0); + MultiByteToWideChar(CP_UTF8, 0, p, len, temp, size); + temp[size] = 0; + + OutputDebugString(temp); +} + +#else + +void OutputDebugStringUTF8(const char *p) { + INFO_LOG(SYSTEM, "%s", p); +} + +#endif diff --git a/Core/Debugger/WebSocket/WebSocketUtils.h b/Core/Debugger/WebSocket/WebSocketUtils.h index 93110db6a0..0da36402c9 100644 --- a/Core/Debugger/WebSocket/WebSocketUtils.h +++ b/Core/Debugger/WebSocket/WebSocketUtils.h @@ -56,7 +56,7 @@ struct DebuggerErrorEvent { LogTypes::LOG_LEVELS level; std::string ticketRaw; - operator std::string() { + operator std::string() const { JsonWriter j; j.begin(); j.writeString("event", "error"); diff --git a/GPU/Directx9/ShaderManagerDX9.cpp b/GPU/Directx9/ShaderManagerDX9.cpp index 15cb7777e8..fd64cb4570 100644 --- a/GPU/Directx9/ShaderManagerDX9.cpp +++ b/GPU/Directx9/ShaderManagerDX9.cpp @@ -23,7 +23,6 @@ #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" diff --git a/GPU/Directx9/StencilBufferDX9.cpp b/GPU/Directx9/StencilBufferDX9.cpp index 722a43b31f..4310a1654e 100644 --- a/GPU/Directx9/StencilBufferDX9.cpp +++ b/GPU/Directx9/StencilBufferDX9.cpp @@ -17,7 +17,6 @@ #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/Vulkan/VulkanUtil.cpp b/GPU/Vulkan/VulkanUtil.cpp index 3d5d196e94..0e653be2b1 100644 --- a/GPU/Vulkan/VulkanUtil.cpp +++ b/GPU/Vulkan/VulkanUtil.cpp @@ -15,8 +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" // For OutputDebugStringUTF8. TODO: Move it. - #include "base/basictypes.h" #include "base/stringutil.h" #include "Common/Log.h" diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 9bacb7de9f..f385475e66 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -22,7 +22,7 @@ SDLJoystick *joystick = NULL; #include #include "base/display.h" -#include "base/logging.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" diff --git a/ext/native/base/logging.h b/ext/native/base/logging.h index 3a22a428fc..c364b8f406 100644 --- a/ext/native/base/logging.h +++ b/ext/native/base/logging.h @@ -46,9 +46,6 @@ inline void Crash() { #endif -// Just ILOGs on nonWindows. On Windows it outputs to the VS output console. -void OutputDebugStringUTF8(const char *p); - #if defined(__ANDROID__) #include diff --git a/ext/native/base/stringutil.cpp b/ext/native/base/stringutil.cpp index ce2e1094fb..adcd94b20a 100644 --- a/ext/native/base/stringutil.cpp +++ b/ext/native/base/stringutil.cpp @@ -21,27 +21,6 @@ #include "base/buffer.h" #include "base/stringutil.h" -#ifdef _WIN32 - -void OutputDebugStringUTF8(const char *p) { - wchar_t temp[4096]; - - int len = std::min(4095, (int)strlen(p)); - int size = (int)MultiByteToWideChar(CP_UTF8, 0, p, len, NULL, 0); - MultiByteToWideChar(CP_UTF8, 0, p, len, temp, size); - temp[size] = 0; - - OutputDebugString(temp); -} - -#else - -void OutputDebugStringUTF8(const char *p) { - INFO_LOG(SYSTEM, "%s", p); -} - -#endif - std::string LineNumberString(const std::string &str) { std::stringstream input(str); std::stringstream output; diff --git a/ext/native/json/json_reader.h b/ext/native/json/json_reader.h index 472a19140d..612a7f9d2f 100644 --- a/ext/native/json/json_reader.h +++ b/ext/native/json/json_reader.h @@ -1,9 +1,9 @@ +#include #include #include #include "base/basictypes.h" #include "ext/gason/gason.h" - #include "Common/Log.h" namespace json { diff --git a/ext/native/thin3d/GLQueueRunner.cpp b/ext/native/thin3d/GLQueueRunner.cpp index 72ca079602..49698384bd 100644 --- a/ext/native/thin3d/GLQueueRunner.cpp +++ b/ext/native/thin3d/GLQueueRunner.cpp @@ -1,7 +1,5 @@ #include -#include "base/logging.h" // For OutputDebugStringUTF8 - #include "base/stringutil.h" #include "gfx/gl_common.h" #include "gfx/gl_debug_log.h" @@ -443,7 +441,7 @@ void GLQueueRunner::InitCreateFramebuffer(const GLRInitStep &step) { retry_depth: if (!fbo->z_stencil_) { - ILOG("Creating %i x %i FBO using no depth", fbo->width, fbo->height); + INFO_LOG(G3D, "Creating %d x %d FBO using no depth", fbo->width, fbo->height); fbo->z_stencil_buffer = 0; fbo->stencil_buffer = 0; @@ -456,7 +454,7 @@ retry_depth: glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0); } else if (gl_extensions.IsGLES) { if (gl_extensions.OES_packed_depth_stencil && (gl_extensions.OES_depth_texture || gl_extensions.GLES3)) { - ILOG("Creating %i x %i FBO using DEPTH24_STENCIL8 texture", fbo->width, fbo->height); + INFO_LOG(G3D, "Creating %d x %d FBO using DEPTH24_STENCIL8 texture", fbo->width, fbo->height); fbo->z_stencil_buffer = 0; fbo->stencil_buffer = 0; fbo->z_buffer = 0; @@ -477,7 +475,7 @@ retry_depth: glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, fbo->z_stencil_texture.texture, 0); } } else if (gl_extensions.OES_packed_depth_stencil) { - ILOG("Creating %i x %i FBO using DEPTH24_STENCIL8", fbo->width, fbo->height); + INFO_LOG(G3D, "Creating %d x %d FBO using DEPTH24_STENCIL8", fbo->width, fbo->height); // Standard method fbo->stencil_buffer = 0; fbo->z_buffer = 0; @@ -492,7 +490,7 @@ retry_depth: glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->z_stencil_buffer); } else { - ILOG("Creating %i x %i FBO using separate stencil", fbo->width, fbo->height); + INFO_LOG(G3D, "Creating %d x %d FBO using separate stencil", fbo->width, fbo->height); // TEGRA fbo->z_stencil_buffer = 0; // 16/24-bit Z, separate 8-bit stencil @@ -513,7 +511,7 @@ retry_depth: glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->stencil_buffer); } } else if (gl_extensions.VersionGEThan(3, 0)) { - ILOG("Creating %i x %i FBO using DEPTH24_STENCIL8 texture", fbo->width, fbo->height); + INFO_LOG(G3D, "Creating %d x %d FBO using DEPTH24_STENCIL8 texture", fbo->width, fbo->height); fbo->z_stencil_buffer = 0; fbo->stencil_buffer = 0; fbo->z_buffer = 0; @@ -549,7 +547,7 @@ retry_depth: switch (status) { case GL_FRAMEBUFFER_COMPLETE: - // ILOG("Framebuffer verified complete."); + // INFO_LOG(G3D, "Framebuffer verified complete."); break; case GL_FRAMEBUFFER_UNSUPPORTED: ERROR_LOG(G3D, "GL_FRAMEBUFFER_UNSUPPORTED"); @@ -558,7 +556,7 @@ retry_depth: ERROR_LOG(G3D, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); break; default: - FLOG("Other framebuffer error: %i", status); + _assert_msg_(false, "Other framebuffer error: %d", status); break; } @@ -1568,7 +1566,7 @@ void GLQueueRunner::fbo_ext_create(const GLRInitStep &step) { GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); switch (status) { case GL_FRAMEBUFFER_COMPLETE_EXT: - // ILOG("Framebuffer verified complete."); + // INFO_LOG(G3D, "Framebuffer verified complete."); break; case GL_FRAMEBUFFER_UNSUPPORTED_EXT: ERROR_LOG(G3D, "GL_FRAMEBUFFER_UNSUPPORTED"); @@ -1577,7 +1575,7 @@ void GLQueueRunner::fbo_ext_create(const GLRInitStep &step) { ERROR_LOG(G3D, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT "); break; default: - FLOG("Other framebuffer error: %i", status); + _assert_msg_(false, "Other framebuffer error: %d", status); break; } // Unbind state we don't need diff --git a/headless/WindowsHeadlessHost.cpp b/headless/WindowsHeadlessHost.cpp index d52dfc4053..18b90d72bf 100644 --- a/headless/WindowsHeadlessHost.cpp +++ b/headless/WindowsHeadlessHost.cpp @@ -15,9 +15,8 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include +#include -#include "base/logging.h" // For OutputDebugStringUTF8 #include "headless/WindowsHeadlessHost.h" #include "Common/Log.h"