Something went wrong. Try again.
OpenMW is an open implementation of the Morrowind engine
Something went wrong. Try again.
789 B · 50 lines
C++
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#ifndef DEBUG_LOG_H#define DEBUG_LOG_H
#include <filesystem>#include <iostream>
namespace Debug{ enum Level : unsigned { Error = 1, Warning = 2, Info = 3, Verbose = 4, Debug = 5, All = 6, };}
class Log{public: static Debug::Level sMinDebugLevel; static bool sWriteLevel;
explicit Log(Debug::Level level); ~Log();
template <typename T> Log& operator<<(const T& rhs) { if (mShouldLog) std::cout << rhs;
return *this; }
Log& operator<<(const std::filesystem::path& rhs);
Log& operator<<(const std::u8string& rhs);
Log& operator<<(std::u8string_view rhs);
Log& operator<<(const char8_t* rhs);
private: const bool mShouldLog;};
#endif