From 3a13e76bb1a8c504ca0f51a8e6503ccd1d19b5be Mon Sep 17 00:00:00 2001 From: jimmyorourke Date: Tue, 3 Sep 2019 14:16:39 -0400 Subject: Use WriteFile rather than WriteConsole to be able to use file handles or pipes --- include/spdlog/sinks/wincolor_sink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/sinks/wincolor_sink.h b/include/spdlog/sinks/wincolor_sink.h index 402fa121..4567a2e3 100644 --- a/include/spdlog/sinks/wincolor_sink.h +++ b/include/spdlog/sinks/wincolor_sink.h @@ -104,7 +104,7 @@ private: void _print_range(const details::log_msg &msg, size_t start, size_t end) { DWORD size = static_cast(end - start); - WriteConsoleA(out_handle_, msg.formatted.data() + start, size, nullptr, nullptr); + WriteFile(out_handle_, msg.formatted.data() + start, size, nullptr, nullptr); } }; -- cgit v1.2.3