10ec8b83dSEd Tanous #pragma once 20ec8b83dSEd Tanous #include <nlohmann/json.hpp> 30ec8b83dSEd Tanous 40ec8b83dSEd Tanous namespace log_service 50ec8b83dSEd Tanous { 60ec8b83dSEd Tanous // clang-format off 70ec8b83dSEd Tanous 80ec8b83dSEd Tanous enum class OverWritePolicy{ 90ec8b83dSEd Tanous Invalid, 100ec8b83dSEd Tanous Unknown, 110ec8b83dSEd Tanous WrapsWhenFull, 120ec8b83dSEd Tanous NeverOverWrites, 130ec8b83dSEd Tanous }; 140ec8b83dSEd Tanous 150ec8b83dSEd Tanous enum class LogEntryTypes{ 160ec8b83dSEd Tanous Invalid, 170ec8b83dSEd Tanous Event, 180ec8b83dSEd Tanous SEL, 190ec8b83dSEd Tanous Multiple, 200ec8b83dSEd Tanous OEM, 210ec8b83dSEd Tanous }; 220ec8b83dSEd Tanous 230ec8b83dSEd Tanous enum class SyslogSeverity{ 240ec8b83dSEd Tanous Invalid, 250ec8b83dSEd Tanous Emergency, 260ec8b83dSEd Tanous Alert, 270ec8b83dSEd Tanous Critical, 280ec8b83dSEd Tanous Error, 290ec8b83dSEd Tanous Warning, 300ec8b83dSEd Tanous Notice, 310ec8b83dSEd Tanous Informational, 320ec8b83dSEd Tanous Debug, 330ec8b83dSEd Tanous All, 340ec8b83dSEd Tanous }; 350ec8b83dSEd Tanous 360ec8b83dSEd Tanous enum class SyslogFacility{ 370ec8b83dSEd Tanous Invalid, 380ec8b83dSEd Tanous Kern, 390ec8b83dSEd Tanous User, 400ec8b83dSEd Tanous Mail, 410ec8b83dSEd Tanous Daemon, 420ec8b83dSEd Tanous Auth, 430ec8b83dSEd Tanous Syslog, 440ec8b83dSEd Tanous LPR, 450ec8b83dSEd Tanous News, 460ec8b83dSEd Tanous UUCP, 470ec8b83dSEd Tanous Cron, 480ec8b83dSEd Tanous Authpriv, 490ec8b83dSEd Tanous FTP, 500ec8b83dSEd Tanous NTP, 510ec8b83dSEd Tanous Security, 520ec8b83dSEd Tanous Console, 530ec8b83dSEd Tanous SolarisCron, 540ec8b83dSEd Tanous Local0, 550ec8b83dSEd Tanous Local1, 560ec8b83dSEd Tanous Local2, 570ec8b83dSEd Tanous Local3, 580ec8b83dSEd Tanous Local4, 590ec8b83dSEd Tanous Local5, 600ec8b83dSEd Tanous Local6, 610ec8b83dSEd Tanous Local7, 620ec8b83dSEd Tanous }; 630ec8b83dSEd Tanous 640ec8b83dSEd Tanous enum class LogDiagnosticDataTypes{ 650ec8b83dSEd Tanous Invalid, 660ec8b83dSEd Tanous Manager, 670ec8b83dSEd Tanous PreOS, 680ec8b83dSEd Tanous OS, 690ec8b83dSEd Tanous OEM, 700ec8b83dSEd Tanous }; 710ec8b83dSEd Tanous 72*a8d8f9d8SEd Tanous enum class LogPurpose{ 73*a8d8f9d8SEd Tanous Invalid, 74*a8d8f9d8SEd Tanous Diagnostic, 75*a8d8f9d8SEd Tanous Operations, 76*a8d8f9d8SEd Tanous Security, 77*a8d8f9d8SEd Tanous Telemetry, 78*a8d8f9d8SEd Tanous ExternalEntity, 79*a8d8f9d8SEd Tanous OEM, 80*a8d8f9d8SEd Tanous }; 81*a8d8f9d8SEd Tanous 820ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(OverWritePolicy, { 830ec8b83dSEd Tanous {OverWritePolicy::Invalid, "Invalid"}, 840ec8b83dSEd Tanous {OverWritePolicy::Unknown, "Unknown"}, 850ec8b83dSEd Tanous {OverWritePolicy::WrapsWhenFull, "WrapsWhenFull"}, 860ec8b83dSEd Tanous {OverWritePolicy::NeverOverWrites, "NeverOverWrites"}, 870ec8b83dSEd Tanous }); 880ec8b83dSEd Tanous 890ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LogEntryTypes, { 900ec8b83dSEd Tanous {LogEntryTypes::Invalid, "Invalid"}, 910ec8b83dSEd Tanous {LogEntryTypes::Event, "Event"}, 920ec8b83dSEd Tanous {LogEntryTypes::SEL, "SEL"}, 930ec8b83dSEd Tanous {LogEntryTypes::Multiple, "Multiple"}, 940ec8b83dSEd Tanous {LogEntryTypes::OEM, "OEM"}, 950ec8b83dSEd Tanous }); 960ec8b83dSEd Tanous 970ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SyslogSeverity, { 980ec8b83dSEd Tanous {SyslogSeverity::Invalid, "Invalid"}, 990ec8b83dSEd Tanous {SyslogSeverity::Emergency, "Emergency"}, 1000ec8b83dSEd Tanous {SyslogSeverity::Alert, "Alert"}, 1010ec8b83dSEd Tanous {SyslogSeverity::Critical, "Critical"}, 1020ec8b83dSEd Tanous {SyslogSeverity::Error, "Error"}, 1030ec8b83dSEd Tanous {SyslogSeverity::Warning, "Warning"}, 1040ec8b83dSEd Tanous {SyslogSeverity::Notice, "Notice"}, 1050ec8b83dSEd Tanous {SyslogSeverity::Informational, "Informational"}, 1060ec8b83dSEd Tanous {SyslogSeverity::Debug, "Debug"}, 1070ec8b83dSEd Tanous {SyslogSeverity::All, "All"}, 1080ec8b83dSEd Tanous }); 1090ec8b83dSEd Tanous 1100ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SyslogFacility, { 1110ec8b83dSEd Tanous {SyslogFacility::Invalid, "Invalid"}, 1120ec8b83dSEd Tanous {SyslogFacility::Kern, "Kern"}, 1130ec8b83dSEd Tanous {SyslogFacility::User, "User"}, 1140ec8b83dSEd Tanous {SyslogFacility::Mail, "Mail"}, 1150ec8b83dSEd Tanous {SyslogFacility::Daemon, "Daemon"}, 1160ec8b83dSEd Tanous {SyslogFacility::Auth, "Auth"}, 1170ec8b83dSEd Tanous {SyslogFacility::Syslog, "Syslog"}, 1180ec8b83dSEd Tanous {SyslogFacility::LPR, "LPR"}, 1190ec8b83dSEd Tanous {SyslogFacility::News, "News"}, 1200ec8b83dSEd Tanous {SyslogFacility::UUCP, "UUCP"}, 1210ec8b83dSEd Tanous {SyslogFacility::Cron, "Cron"}, 1220ec8b83dSEd Tanous {SyslogFacility::Authpriv, "Authpriv"}, 1230ec8b83dSEd Tanous {SyslogFacility::FTP, "FTP"}, 1240ec8b83dSEd Tanous {SyslogFacility::NTP, "NTP"}, 1250ec8b83dSEd Tanous {SyslogFacility::Security, "Security"}, 1260ec8b83dSEd Tanous {SyslogFacility::Console, "Console"}, 1270ec8b83dSEd Tanous {SyslogFacility::SolarisCron, "SolarisCron"}, 1280ec8b83dSEd Tanous {SyslogFacility::Local0, "Local0"}, 1290ec8b83dSEd Tanous {SyslogFacility::Local1, "Local1"}, 1300ec8b83dSEd Tanous {SyslogFacility::Local2, "Local2"}, 1310ec8b83dSEd Tanous {SyslogFacility::Local3, "Local3"}, 1320ec8b83dSEd Tanous {SyslogFacility::Local4, "Local4"}, 1330ec8b83dSEd Tanous {SyslogFacility::Local5, "Local5"}, 1340ec8b83dSEd Tanous {SyslogFacility::Local6, "Local6"}, 1350ec8b83dSEd Tanous {SyslogFacility::Local7, "Local7"}, 1360ec8b83dSEd Tanous }); 1370ec8b83dSEd Tanous 1380ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LogDiagnosticDataTypes, { 1390ec8b83dSEd Tanous {LogDiagnosticDataTypes::Invalid, "Invalid"}, 1400ec8b83dSEd Tanous {LogDiagnosticDataTypes::Manager, "Manager"}, 1410ec8b83dSEd Tanous {LogDiagnosticDataTypes::PreOS, "PreOS"}, 1420ec8b83dSEd Tanous {LogDiagnosticDataTypes::OS, "OS"}, 1430ec8b83dSEd Tanous {LogDiagnosticDataTypes::OEM, "OEM"}, 1440ec8b83dSEd Tanous }); 1450ec8b83dSEd Tanous 146*a8d8f9d8SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LogPurpose, { 147*a8d8f9d8SEd Tanous {LogPurpose::Invalid, "Invalid"}, 148*a8d8f9d8SEd Tanous {LogPurpose::Diagnostic, "Diagnostic"}, 149*a8d8f9d8SEd Tanous {LogPurpose::Operations, "Operations"}, 150*a8d8f9d8SEd Tanous {LogPurpose::Security, "Security"}, 151*a8d8f9d8SEd Tanous {LogPurpose::Telemetry, "Telemetry"}, 152*a8d8f9d8SEd Tanous {LogPurpose::ExternalEntity, "ExternalEntity"}, 153*a8d8f9d8SEd Tanous {LogPurpose::OEM, "OEM"}, 154*a8d8f9d8SEd Tanous }); 155*a8d8f9d8SEd Tanous 1560ec8b83dSEd Tanous } 1570ec8b83dSEd Tanous // clang-format on 158