xref: /openbmc/bmcweb/redfish-core/include/event_log.hpp (revision 4a19a7b5e62ad2569913d944c84c19f1005c922f)
1 #pragma once
2 
3 #include <nlohmann/json.hpp>
4 
5 #include <cstdint>
6 #include <span>
7 #include <string>
8 #include <string_view>
9 #include <vector>
10 
11 namespace redfish
12 {
13 
14 namespace event_log
15 {
16 
17 bool getUniqueEntryID(const std::string& logEntry, std::string& entryID);
18 
19 int getEventLogParams(const std::string& logEntry, std::string& timestamp,
20                       std::string& messageID,
21                       std::vector<std::string>& messageArgs);
22 
23 int formatEventLogEntry(uint64_t eventId, const std::string& logEntryID,
24                         const std::string& messageID,
25                         std::span<std::string_view> messageArgs,
26                         std::string timestamp, const std::string& customText,
27                         nlohmann::json::object_t& logEntryJson);
28 
29 } // namespace event_log
30 
31 } // namespace redfish
32