aboutsummaryrefslogtreecommitdiff
path: root/src/win/DebugLogger.hpp
blob: 5e78af22fa990ab468a45a69f82919edb911252a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "cru/win/WinPreConfig.hpp"

#include "cru/common/Logger.hpp"

namespace cru::platform::win {

class 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