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 | */ |
Patrick Williams | 075c792 | 2024-08-16 15:19:49 -0400 | [diff] [blame] | 39 | std::optional<phosphor::logging::Entry::Level> fixupLogSeverity( |
| 40 | phosphor::logging::Entry::Level obmcSeverity, SeverityType pelSeverity); |
Matt Spinler | 8c686cc | 2019-09-20 13:46:02 -0500 | [diff] [blame] | 41 | } // namespace pels |
| 42 | } // namespace openpower |