diff --git a/logger/log.cpp b/logger/log.cpp index 7bc81075a..51b3e75b1 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 +}