From 240c1d64419b9c3c28d6b8b68f04b05787f0b3bc Mon Sep 17 00:00:00 2001 From: Ploo <239304139+xinitrcn1@users.noreply.github.com> Date: Wed, 7 Jan 2026 16:36:07 +0000 Subject: [PATCH] Update backend.cpp (#3900) --- src/common/logging/backend.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index a65d1d09b..d7c816da3 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -98,6 +98,7 @@ private: std::size_t bytes_written = 0; }; +#ifdef _WIN32 /** * Backend that writes to Visual Studio's output window */ @@ -108,15 +109,14 @@ public: ~DebuggerBackend() = default; void Write(const Entry& entry) { -#ifdef _WIN32 ::OutputDebugStringW(UTF8ToUTF16W(FormatLogMessage(entry).append(1, '\n')).c_str()); -#endif } void Flush() {} void EnableForStacktrace() {} }; +#endif bool initialization_in_progress_suppress_logging = true; @@ -268,7 +268,9 @@ private: } void ForEachBackend(auto lambda) { - // lambda(debugger_backend); +#ifdef _WIN32 + lambda(debugger_backend); +#endif lambda(color_console_backend); lambda(file_backend); } @@ -281,7 +283,9 @@ private: static inline bool should_append{false}; Filter filter; +#ifdef _WIN32 DebuggerBackend debugger_backend{}; +#endif ColorConsoleBackend color_console_backend{}; FileBackend file_backend;