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