MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
log.cpp
Go to the documentation of this file.
1#include "mim/util/log.h"
2
3namespace mim {
4
5// clang-format off
6std::string_view Log::level2acro(Level level) {
7 switch (level) {
8 case Level::Debug: return "D";
9 case Level::Verbose: return "V";
10 case Level::Info: return "I";
11 case Level::Warn: return "W";
12 case Level::Error: return "E";
13 default: fe::unreachable();
14 }
15}
16
17rang::fg Log::level2color(Level level) {
18 switch (level) {
19 case Level::Debug: return rang::fg::yellow;
20 case Level::Verbose: return rang::fg::cyan;
21 case Level::Info: return rang::fg::green;
22 case Level::Warn: return rang::fg::magenta;
23 case Level::Error: return rang::fg::red;
24 default: fe::unreachable();
25 }
26}
27// clang-format on
28
29} // namespace mim
Level level() const
Definition log.h:27
Level
Definition log.h:22
static std::string_view level2acro(Level)
Definition log.cpp:6
static rang::fg level2color(Level level)
Definition log.cpp:17
Definition cfg.h:11