aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/DebugLogger.h
blob: 6a7173ea64dc49246d7fb29696b87245a1a5500e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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