aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/DebugLogger.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-08 16:53:51 +0800
committercrupest <crupest@outlook.com>2022-02-08 16:53:51 +0800
commit74bb9cd27242b9320f99ff4d2b50c3051576cc14 (patch)
tree744bac5799c593d1d6f81e7b09581bea626f2cde /include/cru/win/DebugLogger.h
parentb90c398de829d1ba5329651d75bae82f5e4085fe (diff)
downloadcru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.gz
cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.bz2
cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.zip
...
Diffstat (limited to 'include/cru/win/DebugLogger.h')
-rw-r--r--include/cru/win/DebugLogger.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/cru/win/DebugLogger.h b/include/cru/win/DebugLogger.h
new file mode 100644
index 00000000..6a7173ea
--- /dev/null
+++ b/include/cru/win/DebugLogger.h
@@ -0,0 +1,24 @@
+#pragma once
+#include "Base.h"
+
+#include "cru/common/Logger.h"
+
+namespace cru::platform::win {
+
+class CRU_WIN_API WinDebugLoggerSource : public ::cru::log::ILogSource {
+ public:
+ WinDebugLoggerSource() = default;
+
+ CRU_DELETE_COPY(WinDebugLoggerSource)
+ CRU_DELETE_MOVE(WinDebugLoggerSource)
+
+ ~WinDebugLoggerSource() = default;
+
+ void Write(::cru::log::LogLevel level, StringView s) override {
+ CRU_UNUSED(level)
+
+ String m = s.ToString();
+ ::OutputDebugStringW(reinterpret_cast<const wchar_t*>(m.c_str()));
+ }
+};
+} // namespace cru::platform::win