Update backend.cpp (#3900)

This commit is contained in:
Ploo
2026-01-07 16:36:07 +00:00
committed by GitHub
parent 299159b1e0
commit 240c1d6441

View File

@@ -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;