diff options
Diffstat (limited to 'include/cru/win/DebugLogger.h')
-rw-r--r-- | include/cru/win/DebugLogger.h | 24 |
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 |