1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace log_service
5 {
6 // clang-format off
7 
8 enum class OverWritePolicy{
9     Invalid,
10     Unknown,
11     WrapsWhenFull,
12     NeverOverWrites,
13 };
14 
15 enum class LogEntryTypes{
16     Invalid,
17     Event,
18     SEL,
19     Multiple,
20     OEM,
21     CXL,
22 };
23 
24 enum class SyslogSeverity{
25     Invalid,
26     Emergency,
27     Alert,
28     Critical,
29     Error,
30     Warning,
31     Notice,
32     Informational,
33     Debug,
34     All,
35 };
36 
37 enum class SyslogFacility{
38     Invalid,
39     Kern,
40     User,
41     Mail,
42     Daemon,
43     Auth,
44     Syslog,
45     LPR,
46     News,
47     UUCP,
48     Cron,
49     Authpriv,
50     FTP,
51     NTP,
52     Security,
53     Console,
54     SolarisCron,
55     Local0,
56     Local1,
57     Local2,
58     Local3,
59     Local4,
60     Local5,
61     Local6,
62     Local7,
63 };
64 
65 enum class LogDiagnosticDataTypes{
66     Invalid,
67     Manager,
68     PreOS,
69     OS,
70     OEM,
71 };
72 
73 enum class LogPurpose{
74     Invalid,
75     Diagnostic,
76     Operations,
77     Security,
78     Telemetry,
79     ExternalEntity,
80     OEM,
81 };
82 
83 NLOHMANN_JSON_SERIALIZE_ENUM(OverWritePolicy, {
84     {OverWritePolicy::Invalid, "Invalid"},
85     {OverWritePolicy::Unknown, "Unknown"},
86     {OverWritePolicy::WrapsWhenFull, "WrapsWhenFull"},
87     {OverWritePolicy::NeverOverWrites, "NeverOverWrites"},
88 });
89 
90 NLOHMANN_JSON_SERIALIZE_ENUM(LogEntryTypes, {
91     {LogEntryTypes::Invalid, "Invalid"},
92     {LogEntryTypes::Event, "Event"},
93     {LogEntryTypes::SEL, "SEL"},
94     {LogEntryTypes::Multiple, "Multiple"},
95     {LogEntryTypes::OEM, "OEM"},
96     {LogEntryTypes::CXL, "CXL"},
97 });
98 
99 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogSeverity, {
100     {SyslogSeverity::Invalid, "Invalid"},
101     {SyslogSeverity::Emergency, "Emergency"},
102     {SyslogSeverity::Alert, "Alert"},
103     {SyslogSeverity::Critical, "Critical"},
104     {SyslogSeverity::Error, "Error"},
105     {SyslogSeverity::Warning, "Warning"},
106     {SyslogSeverity::Notice, "Notice"},
107     {SyslogSeverity::Informational, "Informational"},
108     {SyslogSeverity::Debug, "Debug"},
109     {SyslogSeverity::All, "All"},
110 });
111 
112 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogFacility, {
113     {SyslogFacility::Invalid, "Invalid"},
114     {SyslogFacility::Kern, "Kern"},
115     {SyslogFacility::User, "User"},
116     {SyslogFacility::Mail, "Mail"},
117     {SyslogFacility::Daemon, "Daemon"},
118     {SyslogFacility::Auth, "Auth"},
119     {SyslogFacility::Syslog, "Syslog"},
120     {SyslogFacility::LPR, "LPR"},
121     {SyslogFacility::News, "News"},
122     {SyslogFacility::UUCP, "UUCP"},
123     {SyslogFacility::Cron, "Cron"},
124     {SyslogFacility::Authpriv, "Authpriv"},
125     {SyslogFacility::FTP, "FTP"},
126     {SyslogFacility::NTP, "NTP"},
127     {SyslogFacility::Security, "Security"},
128     {SyslogFacility::Console, "Console"},
129     {SyslogFacility::SolarisCron, "SolarisCron"},
130     {SyslogFacility::Local0, "Local0"},
131     {SyslogFacility::Local1, "Local1"},
132     {SyslogFacility::Local2, "Local2"},
133     {SyslogFacility::Local3, "Local3"},
134     {SyslogFacility::Local4, "Local4"},
135     {SyslogFacility::Local5, "Local5"},
136     {SyslogFacility::Local6, "Local6"},
137     {SyslogFacility::Local7, "Local7"},
138 });
139 
140 NLOHMANN_JSON_SERIALIZE_ENUM(LogDiagnosticDataTypes, {
141     {LogDiagnosticDataTypes::Invalid, "Invalid"},
142     {LogDiagnosticDataTypes::Manager, "Manager"},
143     {LogDiagnosticDataTypes::PreOS, "PreOS"},
144     {LogDiagnosticDataTypes::OS, "OS"},
145     {LogDiagnosticDataTypes::OEM, "OEM"},
146 });
147 
148 NLOHMANN_JSON_SERIALIZE_ENUM(LogPurpose, {
149     {LogPurpose::Invalid, "Invalid"},
150     {LogPurpose::Diagnostic, "Diagnostic"},
151     {LogPurpose::Operations, "Operations"},
152     {LogPurpose::Security, "Security"},
153     {LogPurpose::Telemetry, "Telemetry"},
154     {LogPurpose::ExternalEntity, "ExternalEntity"},
155     {LogPurpose::OEM, "OEM"},
156 });
157 
158 }
159 // clang-format on
160