// SPDX-License-Identifier: MIT #include #include #include #include #include #include namespace { void (*WineDbgOut)(const char* Message); void MsgHandler(LogMan::DebugLevels Level, const char* Message) { const auto Output = fextl::fmt::format("[{}][{:X}] {}\n", LogMan::DebugLevelStr(Level), GetCurrentThreadId(), Message); WineDbgOut(Output.c_str()); } void AssertHandler(const char* Message) { const auto Output = fextl::fmt::format("[ASSERT] {}\n", Message); WineDbgOut(Output.c_str()); } } // namespace namespace FEX::Windows::Logging { void Init() { WineDbgOut = reinterpret_cast(GetProcAddress(GetModuleHandleA("ntdll.dll"), "__wine_dbg_output")); LogMan::Throw::InstallHandler(AssertHandler); LogMan::Msg::InstallHandler(MsgHandler); } } // namespace FEX::Windows::Logging