Matt Spinler | 8c686cc | 2019-09-20 13:46:02 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "elog_entry.hpp" |
Matt Spinler | 8b81ec0 | 2022-07-12 13:25:37 -0500 | [diff] [blame] | 4 | #include "pel_types.hpp" |
| 5 | |
| 6 | #include <optional> |
Matt Spinler | 8c686cc | 2019-09-20 13:46:02 -0500 | [diff] [blame] | 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 | |
Matt Spinler | 8b81ec0 | 2022-07-12 13:25:37 -0500 | [diff] [blame] | 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> |
| 40 | fixupLogSeverity(phosphor::logging::Entry::Level obmcSeverity, |
| 41 | SeverityType pelSeverity); |
Matt Spinler | 8c686cc | 2019-09-20 13:46:02 -0500 | [diff] [blame] | 42 | } // namespace pels |
| 43 | } // namespace openpower |