Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 1 | #include <attn/attn_logging.hpp> |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 2 | |
| 3 | #include <iostream> |
| 4 | |
| 5 | namespace attn |
| 6 | { |
| 7 | |
| 8 | /** @brief Log message of type INFO using stdout */ |
| 9 | template <> |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 10 | void trace<INFO>(const char* i_message) |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 11 | { |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 12 | std::cout << "trace: " << i_message << std::endl; |
| 13 | } |
| 14 | |
Ben Tyner | b3eba29 | 2021-02-10 16:17:08 -0600 | [diff] [blame] | 15 | /** @brief Log message of type ERROR using stdout */ |
| 16 | template <> |
| 17 | void trace<ERROR>(const char* i_message) |
| 18 | { |
| 19 | std::cout << "error: " << i_message << std::endl; |
| 20 | } |
| 21 | |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 22 | void eventAttentionFail(int i_error) |
| 23 | { |
| 24 | std::cout << "event: attention fail" << i_error << std::endl; |
| 25 | } |
| 26 | |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 27 | void eventTerminate(std::map<std::string, std::string> i_additionalData, |
| 28 | char* i_tiInfoData) |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 29 | { |
| 30 | std::cout << "event: terminate" << std::endl; |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 31 | |
| 32 | std::map<std::string, std::string>::iterator itr; |
| 33 | for (itr = i_additionalData.begin(); itr != i_additionalData.end(); ++itr) |
| 34 | { |
| 35 | std::cout << '\t' << itr->first << '\t' << itr->second << '\n'; |
| 36 | } |
| 37 | std::cout << std::endl; |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 38 | |
| 39 | if (nullptr != i_tiInfoData) |
| 40 | { |
| 41 | std::cout << "TI data present" << std::endl; |
| 42 | } |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 43 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 44 | |
Ben Tyner | 7f6ce6a | 2021-08-17 19:40:00 -0500 | [diff] [blame] | 45 | uint32_t eventVital() |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 46 | { |
| 47 | std::cout << "event: vital" << std::endl; |
Ben Tyner | 7f6ce6a | 2021-08-17 19:40:00 -0500 | [diff] [blame] | 48 | return 0; |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 49 | } |
| 50 | |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 51 | void eventPhalSbeChipop(uint32_t proc) |
| 52 | { |
| 53 | std::cout << "event: sbe timeout proc " << proc << std::endl; |
| 54 | } |
| 55 | |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 56 | } // namespace attn |