source: s10k/CommonLibs/plog/Severity.h@ 1094

Last change on this file since 1094 was 1073, checked in by s10k, 7 years ago

added XML Tools latest version (2.0d) and s10k's common libs

File size: 1.0 KB
Line 
1#pragma once
2
3namespace plog
4{
5 enum Severity
6 {
7 none = 0,
8 fatal = 1,
9 error = 2,
10 warning = 3,
11 info = 4,
12 debug = 5,
13 verbose = 6
14 };
15
16 inline const char* severityToString(Severity severity)
17 {
18 switch (severity)
19 {
20 case fatal:
21 return "FATAL";
22 case error:
23 return "ERROR";
24 case warning:
25 return "WARN";
26 case info:
27 return "INFO";
28 case debug:
29 return "DEBUG";
30 case verbose:
31 return "VERB";
32 default:
33 return "NONE";
34 }
35 }
36
37 inline Severity severityFromString(const char* str)
38 {
39 for (Severity severity = fatal; severity <= verbose; severity = static_cast<Severity>(severity + 1))
40 {
41 if (severityToString(severity)[0] == str[0])
42 {
43 return severity;
44 }
45 }
46
47 return none;
48 }
49}
Note: See TracBrowser for help on using the repository browser.