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