#pragma once #include #ifdef _WIN32 #define __PRETTY_FUNCTION__ __FUNCTION__ #endif namespace pixelarium::utils::log { enum class LogLevel { kTrace = 1 << 0, kDebug = 1 << 1, kInfo = 1 << 2, kWarn = 1 << 3, kError = 1 << 4, }; constexpr auto LogLevelToString(LogLevel lvl) -> std::string { switch (lvl) { case LogLevel::kTrace: return "Trace"; case LogLevel::kDebug: return "Debug"; case LogLevel::kInfo: return "Info"; case LogLevel::kWarn: return "Warning"; case LogLevel::kError: return "Error"; } } /// @brief Interface for logging implementations. class ILog { public: virtual void Info(const std::string& msg) const = 0; virtual void Debug(const std::string& msg) const = 0; virtual void Warn(const std::string& msg) const = 0; virtual void Error(const std::string& msg) const = 0; virtual void ChangeLevel(LogLevel lvl) const = 0; virtual ~ILog() {} }; } // namespace pixelarium::utils::log