1 #pragma once
2 
3 #include "elog_entry.hpp"
4 #include "pel_types.hpp"
5 
6 #include <optional>
7 
8 namespace openpower
9 {
10 namespace pels
11 {
12 
13 /**
14  * @brief Convert an OpenBMC event log severity to a PEL severity
15  *
16  * @param[in] severity - The OpenBMC event log severity
17  *
18  * @return uint8_t - The PEL severity value
19  */
20 uint8_t convertOBMCSeverityToPEL(phosphor::logging::Entry::Level severity);
21 
22 /**
23  * @brief Possibly calculate a new LogSeverity value based on the
24  *        current LogSeverity and PEL severity.
25  *
26  * Just handles cases where the LogSeverity value is clearly out of
27  * sync with the PEL severity:
28  * - critical PEL but non critical LogSeverity
29  * - info PEL but non info LogSeverity
30  * - non info PEL but info LogSeverity
31  *
32  * @param[in] obmcSeverity - The current LogSeverity
33  * @param[in] pelSeverity - The PEL severity
34  *
35  * @return optional<LogSeverity> The new LogSeverity to use if one was
36  *         found, otherwise std::nullopt which means the original one
37  *         is good enough.
38  */
39 std::optional<phosphor::logging::Entry::Level> fixupLogSeverity(
40     phosphor::logging::Entry::Level obmcSeverity, SeverityType pelSeverity);
41 } // namespace pels
42 } // namespace openpower
43