summaryrefslogtreecommitdiffstats
path: root/src/common/logging/backend.cpp
diff options
context:
space:
mode:
authorgreggameplayer <33609333+greggameplayer@users.noreply.github.com>2018-11-06 19:05:57 +0100
committerGitHub <noreply@github.com>2018-11-06 19:05:57 +0100
commitd3b9599b2dd084db5b180a6b13ea0ceaec5c7587 (patch)
tree79bcd8922cb90d06b61e07b5cc6e84e320aa3128 /src/common/logging/backend.cpp
parentcorrect syntax (diff)
parentMerge pull request #1649 from degasus/split_resource_manager (diff)
downloadyuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.gz
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.bz2
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.lz
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.xz
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.zst
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.zip
Diffstat (limited to 'src/common/logging/backend.cpp')
-rw-r--r--src/common/logging/backend.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 6d5218465..5753b871a 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) \