Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <cstddef> // for size_t |
| 4 | #include <map> |
| 5 | #include <string> |
| 6 | |
| 7 | namespace attn |
| 8 | { |
| 9 | |
| 10 | /** @brief Logging level types */ |
| 11 | enum level |
| 12 | { |
| 13 | INFO |
| 14 | }; |
| 15 | |
| 16 | /** @brief Logging event types */ |
| 17 | enum class EventType |
| 18 | { |
| 19 | Checkstop = 0, |
| 20 | Terminate = 1, |
| 21 | Vital = 2, |
| 22 | HwDiagsFail = 3, |
| 23 | AttentionFail = 4 |
| 24 | }; |
| 25 | |
| 26 | /** @brief Maximum length of a single trace event message */ |
| 27 | static const size_t trace_msg_max_len = 255; |
| 28 | |
| 29 | /** @brief create trace message */ |
| 30 | template <level L> |
| 31 | void trace(const char* i_message); |
| 32 | |
| 33 | /** @brief commit checkstop event to log */ |
| 34 | void eventCheckstop(std::map<std::string, std::string>& i_errors); |
| 35 | |
| 36 | /** @brief commit special attention TI event to log */ |
| 37 | void eventTerminate(); |
| 38 | |
| 39 | /** @brief commit SBE vital event to log */ |
| 40 | void eventVital(); |
| 41 | |
| 42 | /** @brief commit analyzer failure event to log */ |
| 43 | void eventHwDiagsFail(int i_error); |
| 44 | |
| 45 | /** @brief commit attention handler failure event to log */ |
| 46 | void eventAttentionFail(int i_error); |
| 47 | |
| 48 | } // namespace attn |