aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/DebugLogger.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-28 22:32:22 +0800
committercrupest <crupest@outlook.com>2022-01-28 22:32:22 +0800
commit27ef6b29fe9ea6931dd9aef585e8b9467599b5f1 (patch)
treeb6c6f2162a9561e1f86568717649913999cbb3e7 /include/cru/win/DebugLogger.hpp
parentaf43f72adcb6738eebaad505389084c17411a694 (diff)
downloadcru-27ef6b29fe9ea6931dd9aef585e8b9467599b5f1.tar.gz
cru-27ef6b29fe9ea6931dd9aef585e8b9467599b5f1.tar.bz2
cru-27ef6b29fe9ea6931dd9aef585e8b9467599b5f1.zip
...
Diffstat (limited to 'include/cru/win/DebugLogger.hpp')
-rw-r--r--include/cru/win/DebugLogger.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/cru/win/DebugLogger.hpp b/include/cru/win/DebugLogger.hpp
new file mode 100644
index 00000000..05793607
--- /dev/null
+++ b/include/cru/win/DebugLogger.hpp
@@ -0,0 +1,24 @@
+#pragma once
+#include "Base.hpp"
+
+#include "cru/common/Logger.hpp"
+
+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