diff options
author | Carl Kenner <carl.kenner@gmail.com> | 2018-10-05 05:22:49 +0200 |
---|---|---|
committer | Carl Kenner <carl.kenner@gmail.com> | 2018-10-07 04:54:04 +0200 |
commit | f5f6292810dab70bc9be0fa4d9f37fe2b5544d86 (patch) | |
tree | 1ec449a6d6e33a36a3133de2196954a6967af9ad /src/common/logging/backend.cpp | |
parent | Merge pull request #1450 from FearlessTobi/port-4312 (diff) | |
download | yuzu-f5f6292810dab70bc9be0fa4d9f37fe2b5544d86.tar yuzu-f5f6292810dab70bc9be0fa4d9f37fe2b5544d86.tar.gz yuzu-f5f6292810dab70bc9be0fa4d9f37fe2b5544d86.tar.bz2 yuzu-f5f6292810dab70bc9be0fa4d9f37fe2b5544d86.tar.lz yuzu-f5f6292810dab70bc9be0fa4d9f37fe2b5544d86.tar.xz yuzu-f5f6292810dab70bc9be0fa4d9f37fe2b5544d86.tar.zst yuzu-f5f6292810dab70bc9be0fa4d9f37fe2b5544d86.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/logging/backend.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 9f5918851..31ad72f38 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -12,7 +12,8 @@ #include <thread> #include <vector> #ifdef _WIN32 -#include <share.h> // For _SH_DENYWR +#include <share.h> // For _SH_DENYWR +#include <windows.h> // For OutputDebugStringA #else #define _SH_DENYWR 0 #endif @@ -139,12 +140,18 @@ void FileBackend::Write(const Entry& entry) { if (!file.IsOpen() || bytes_written > MAX_BYTES_WRITTEN) { return; } - bytes_written += file.WriteString(FormatLogMessage(entry) + '\n'); + bytes_written += file.WriteString(FormatLogMessage(entry).append(1, '\n')); if (entry.log_level >= Level::Error) { file.Flush(); } } +void DebuggerBackend::Write(const Entry& entry) { +#ifdef _WIN32 + ::OutputDebugStringA(FormatLogMessage(entry).append(1, '\n').c_str()); +#endif +} + /// Macro listing all log classes. Code should define CLS and SUB as desired before invoking this. #define ALL_LOG_CLASSES() \ CLS(Log) \ |