20 lines
477 B
C++
20 lines
477 B
C++
#pragma once
|
|
#include <string_view>
|
|
|
|
namespace vl::logging {
|
|
|
|
enum class Level : unsigned char { Trace, Debug, Info, Warn, Error };
|
|
|
|
constexpr std::string_view toString(Level lvl) noexcept {
|
|
switch (lvl) {
|
|
case Level::Trace: return "TRACE";
|
|
case Level::Debug: return "DEBUG";
|
|
case Level::Info: return "INFO";
|
|
case Level::Warn: return "WARN";
|
|
case Level::Error: return "ERROR";
|
|
}
|
|
return "UNKNOWN";
|
|
}
|
|
|
|
} // namespace vl::log
|