1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace log_entry 5 { 6 // clang-format off 7 8 enum class EventSeverity{ 9 Invalid, 10 OK, 11 Warning, 12 Critical, 13 }; 14 15 enum class LogEntryType{ 16 Invalid, 17 Event, 18 SEL, 19 Oem, 20 CXL, 21 }; 22 23 enum class LogDiagnosticDataTypes{ 24 Invalid, 25 Manager, 26 PreOS, 27 OS, 28 OEM, 29 CPER, 30 CPERSection, 31 }; 32 33 enum class OriginatorTypes{ 34 Invalid, 35 Client, 36 Internal, 37 SupportingService, 38 }; 39 40 enum class CXLEntryType{ 41 Invalid, 42 DynamicCapacity, 43 Informational, 44 Warning, 45 Failure, 46 Fatal, 47 }; 48 49 NLOHMANN_JSON_SERIALIZE_ENUM(EventSeverity, { 50 {EventSeverity::Invalid, "Invalid"}, 51 {EventSeverity::OK, "OK"}, 52 {EventSeverity::Warning, "Warning"}, 53 {EventSeverity::Critical, "Critical"}, 54 }); 55 56 NLOHMANN_JSON_SERIALIZE_ENUM(LogEntryType, { 57 {LogEntryType::Invalid, "Invalid"}, 58 {LogEntryType::Event, "Event"}, 59 {LogEntryType::SEL, "SEL"}, 60 {LogEntryType::Oem, "Oem"}, 61 {LogEntryType::CXL, "CXL"}, 62 }); 63 64 NLOHMANN_JSON_SERIALIZE_ENUM(LogDiagnosticDataTypes, { 65 {LogDiagnosticDataTypes::Invalid, "Invalid"}, 66 {LogDiagnosticDataTypes::Manager, "Manager"}, 67 {LogDiagnosticDataTypes::PreOS, "PreOS"}, 68 {LogDiagnosticDataTypes::OS, "OS"}, 69 {LogDiagnosticDataTypes::OEM, "OEM"}, 70 {LogDiagnosticDataTypes::CPER, "CPER"}, 71 {LogDiagnosticDataTypes::CPERSection, "CPERSection"}, 72 }); 73 74 NLOHMANN_JSON_SERIALIZE_ENUM(OriginatorTypes, { 75 {OriginatorTypes::Invalid, "Invalid"}, 76 {OriginatorTypes::Client, "Client"}, 77 {OriginatorTypes::Internal, "Internal"}, 78 {OriginatorTypes::SupportingService, "SupportingService"}, 79 }); 80 81 NLOHMANN_JSON_SERIALIZE_ENUM(CXLEntryType, { 82 {CXLEntryType::Invalid, "Invalid"}, 83 {CXLEntryType::DynamicCapacity, "DynamicCapacity"}, 84 {CXLEntryType::Informational, "Informational"}, 85 {CXLEntryType::Warning, "Warning"}, 86 {CXLEntryType::Failure, "Failure"}, 87 {CXLEntryType::Fatal, "Fatal"}, 88 }); 89 90 } 91 // clang-format on 92