From e88fe1845abd9f8735228981d136294a1a307e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Ro=C3=9F?= Date: Sun, 27 Oct 2024 16:09:06 +0100 Subject: [PATCH] [Logger] Enable logging to VS output window --- logger/log.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/logger/log.cpp b/logger/log.cpp index 7bc81075..51b3e75b 100644 --- a/logger/log.cpp +++ b/logger/log.cpp @@ -22,6 +22,7 @@ #include #ifdef WIN32 +#include #include #include #include "debug.h" @@ -35,6 +36,8 @@ void InitLog(plog::Severity log_level, bool enable_filelog, bool enable_win_cons static plog::RollingFileAppender fileAppender(log_file.u8string().c_str()); #ifdef WIN32 + static plog::DebugOutputAppender debugAppender; + if (enable_win_console) { // Open console window AllocConsole(); @@ -53,4 +56,9 @@ void InitLog(plog::Severity log_level, bool enable_filelog, bool enable_win_cons } plog::get()->addAppender(&fileAppender); } -} \ No newline at end of file +#ifdef WIN32 + if (IsDebuggerPresent()) { + plog::get()->addAppender(&debugAppender); + } +#endif +}