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 | |
| 15 | void eventCheckstop(std::map<std::string, std::string>& i_errors) |
| 16 | { |
| 17 | std::string signature = i_errors.begin()->first; |
| 18 | std::string chip = i_errors.begin()->second; |
| 19 | |
| 20 | std::cout << "event: checkstop, signature = " << signature |
| 21 | << ", chip = " << chip << std::endl; |
| 22 | } |
| 23 | |
| 24 | void eventHwDiagsFail(int i_error) |
| 25 | { |
| 26 | std::cout << "event: hwdiags fail " << i_error << std::endl; |
| 27 | } |
| 28 | |
| 29 | void eventAttentionFail(int i_error) |
| 30 | { |
| 31 | std::cout << "event: attention fail" << i_error << std::endl; |
| 32 | } |
| 33 | |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 34 | void eventTerminate(std::map<std::string, std::string> i_additionalData) |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 35 | { |
| 36 | std::cout << "event: terminate" << std::endl; |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 37 | |
| 38 | std::map<std::string, std::string>::iterator itr; |
| 39 | for (itr = i_additionalData.begin(); itr != i_additionalData.end(); ++itr) |
| 40 | { |
| 41 | std::cout << '\t' << itr->first << '\t' << itr->second << '\n'; |
| 42 | } |
| 43 | std::cout << std::endl; |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 44 | } |
Ben Tyner | 4071772 | 2020-09-23 09:43:20 -0500 | [diff] [blame] | 45 | |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 46 | void eventVital() |
| 47 | { |
| 48 | std::cout << "event: vital" << std::endl; |
Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | } // namespace attn |