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
3
namespace
mim
{
4
5
// clang-format off
6
std::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
17
rang::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
mim::Log::level
Level level() const
Definition
log.h:27
mim::Log::Level
Level
Definition
log.h:22
mim::Log::Level::Info
@ Info
mim::Log::Level::Warn
@ Warn
mim::Log::Level::Error
@ Error
mim::Log::Level::Debug
@ Debug
mim::Log::Level::Verbose
@ Verbose
mim::Log::level2acro
static std::string_view level2acro(Level)
Definition
log.cpp:6
mim::Log::level2color
static rang::fg level2color(Level level)
Definition
log.cpp:17
log.h
mim
Definition
cfg.h:11
src
mim
util
log.cpp
Generated by
1.12.0