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;