diff --git a/Utilities/SMutex.h b/Utilities/SMutex.h index c67578d7b2..f4bdc7dff9 100644 --- a/Utilities/SMutex.h +++ b/Utilities/SMutex.h @@ -150,8 +150,7 @@ public: { if (!Emu.IsStopped()) { - LOG_ERROR(HLE, "SMutexLockerBase: thread id == 0"); - Emu.Pause(); + assert(!"SMutexLockerBase: thread id == 0"); } return; } diff --git a/rpcs3/Emu/IdManager.h b/rpcs3/Emu/IdManager.h index b1170cce04..b985f886cc 100644 --- a/rpcs3/Emu/IdManager.h +++ b/rpcs3/Emu/IdManager.h @@ -1,5 +1,6 @@ #pragma once #include +#include #define rID_ANY -1 // was wxID_ANY diff --git a/rpcs3/Emu/SysCalls/LogBase.cpp b/rpcs3/Emu/SysCalls/LogBase.cpp new file mode 100644 index 0000000000..d74364e589 --- /dev/null +++ b/rpcs3/Emu/SysCalls/LogBase.cpp @@ -0,0 +1,18 @@ +#include "stdafx.h" +#include "Utilities/Log.h" +#include "LogBase.h" + +void LogBase::LogNotice(const std::string& text) +{ + LOG_NOTICE(HLE, "%s", text.c_str()); +} + +void LogBase::LogWarning(const std::string& text) +{ + LOG_WARNING(HLE, "%s", text.c_str()); +} + +void LogBase::LogError(const std::string& text) +{ + LOG_ERROR(HLE, "%s", text.c_str()); +} \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/LogBase.h b/rpcs3/Emu/SysCalls/LogBase.h index 3c583aa8e6..317e999273 100644 --- a/rpcs3/Emu/SysCalls/LogBase.h +++ b/rpcs3/Emu/SysCalls/LogBase.h @@ -4,18 +4,16 @@ class LogBase { bool m_logging; + void LogNotice(const std::string& text); + void LogWarning(const std::string& text); + void LogError(const std::string& text); + public: void SetLogging(bool value) { m_logging = value; } - bool GetLogging() - { - //return m_logging; // TODO - return Ini.HLELogging.GetValue(); - } - LogBase() { SetLogging(false); @@ -25,17 +23,17 @@ public: template void Notice(const u32 id, const char* fmt, Targs... args) { - LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); + LogNotice(GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); } template void Notice(const char* fmt, Targs... args) { - LOG_NOTICE(HLE, GetName() + ": " + fmt::Format(fmt, args...)); + LogNotice(GetName() + ": " + fmt::Format(fmt, args...)); } template __forceinline void Log(const char* fmt, Targs... args) { - if (GetLogging()) + if (m_logging) { Notice(fmt, args...); } @@ -43,7 +41,7 @@ public: template __forceinline void Log(const u32 id, const char* fmt, Targs... args) { - if (GetLogging()) + if (m_logging) { Notice(id, fmt, args...); } @@ -51,31 +49,31 @@ public: template void Warning(const u32 id, const char* fmt, Targs... args) { - LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); + LogWarning(GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); } template void Warning(const char* fmt, Targs... args) { - LOG_WARNING(HLE, GetName() + " warning: " + fmt::Format(fmt, args...)); + LogWarning(GetName() + " warning: " + fmt::Format(fmt, args...)); } template void Error(const u32 id, const char* fmt, Targs... args) { - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); + LogError(GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); } template void Error(const char* fmt, Targs... args) { - LOG_ERROR(HLE, GetName() + " error: " + fmt::Format(fmt, args...)); + LogError(GetName() + " error: " + fmt::Format(fmt, args...)); } template void Todo(const u32 id, const char* fmt, Targs... args) { - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); + LogError(GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); } template void Todo(const char* fmt, Targs... args) { - LOG_ERROR(HLE, GetName() + " TODO: " + fmt::Format(fmt, args...)); + LogError(GetName() + " TODO: " + fmt::Format(fmt, args...)); } }; \ No newline at end of file diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 7ce030b02a..142f07ce89 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -93,6 +93,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 271fa80725..7f758f7a2b 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -605,6 +605,9 @@ Utilities + + Emu\SysCalls + @@ -1155,7 +1158,7 @@ Emu\SysCalls\Modules - + Emu