Windows: Commonise logging code

This commit is contained in:
Billy Laws committed 2024-08-01 11:45:07 +00:00
1 parent 49b8dae189
commit 05155778d4
5 files changed
+39 -37

No files matched your search

+2 -18
View File
@@ -28,6 +28,7 @@ $end_info$
#include "Common/InvalidationTracker.h"
#include "Common/TSOHandlerConfig.h"
#include "Common/CPUFeatures.h"
#include "Common/Logging.h"
#include "DummyHandlers.h"
#include "BTInterface.h"
@@ -378,23 +379,6 @@ static void RethrowGuestException(const EXCEPTION_RECORD& Rec, ARM64_NT_CONTEXT&
}
} // namespace Exception
namespace Logging {
static void MsgHandler(LogMan::DebugLevels Level, const char* Message) {
const auto Output = fextl::fmt::format("[{}][{:X}] {}\n", LogMan::DebugLevelStr(Level), GetCurrentThreadId(), Message);
__wine_dbg_output(Output.c_str());
}
static void AssertHandler(const char* Message) {
const auto Output = fextl::fmt::format("[ASSERT] {}\n", Message);
__wine_dbg_output(Output.c_str());
}
static void Init() {
LogMan::Throw::InstallHandler(AssertHandler);
LogMan::Msg::InstallHandler(MsgHandler);
}
} // namespace Logging
class ECSyscallHandler : public FEXCore::HLE::SyscallHandler, public FEXCore::Allocator::FEXAllocOperators {
public:
ECSyscallHandler() {
@@ -424,7 +408,7 @@ extern "C" void SyncThreadContext(CONTEXT* Context) {
}
void ProcessInit() {
Logging::Init();
FEX::Windows::Logging::Init();
FEX::Config::InitializeConfigs();
FEXCore::Config::Initialize();
FEXCore::Config::AddLayer(FEX::Config::CreateGlobalMainLayer());