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