-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog_level.h
39 lines (34 loc) · 1017 Bytes
/
log_level.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include <motor/core/std/string>
namespace motor
{
namespace log
{
enum class log_level
{
raw,
status,
warning,
error,
critical,
timing
};
namespace motor_internal
{
static motor::core::string_t const __log_level_strings[] = {
"raw", "status", "warning", "error", "critical", "timing"
} ;
static motor::core::string_t const __log_level_short_strings[] = {
"", "[s]", "[w]", "[e]", "[c]", "[t]"
} ;
}
static motor::core::string_cref_t to_string( log_level const level ) noexcept
{
return motor_internal::__log_level_strings[ size_t( level ) ] ;
}
static motor::core::string_cref_t const& to_string_short( log_level const level ) noexcept
{
return motor_internal::__log_level_short_strings[ size_t( level ) ] ;
}
}
}