blob: 9fe119eab5c31b8bcb434acb3ed4dd15440b7ac5 [file] [log] [blame]
Ben Tynerb1ebfcb2020-05-08 18:52:48 -05001#include <attn/attn_logging.hpp>
Ben Tyner9ae5ca42020-02-28 13:13:50 -06002
3#include <iostream>
4
5namespace attn
6{
7
8/** @brief Log message of type INFO using stdout */
9template <>
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050010void trace<INFO>(const char* i_message)
Ben Tyner9ae5ca42020-02-28 13:13:50 -060011{
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050012 std::cout << "trace: " << i_message << std::endl;
13}
14
Ben Tynerb3eba292021-02-10 16:17:08 -060015/** @brief Log message of type ERROR using stdout */
16template <>
17void trace<ERROR>(const char* i_message)
18{
19 std::cout << "error: " << i_message << std::endl;
20}
21
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050022void eventAttentionFail(int i_error)
23{
24 std::cout << "event: attention fail" << i_error << std::endl;
25}
26
Ben Tynerf5210bb2021-01-05 12:58:10 -060027void eventTerminate(std::map<std::string, std::string> i_additionalData,
28 char* i_tiInfoData)
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050029{
30 std::cout << "event: terminate" << std::endl;
Ben Tyner40717722020-09-23 09:43:20 -050031
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 Tynerf5210bb2021-01-05 12:58:10 -060038
39 if (nullptr != i_tiInfoData)
40 {
41 std::cout << "TI data present" << std::endl;
42 }
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050043}
Ben Tyner40717722020-09-23 09:43:20 -050044
Ben Tyner7f6ce6a2021-08-17 19:40:00 -050045uint32_t eventVital()
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050046{
47 std::cout << "event: vital" << std::endl;
Ben Tyner7f6ce6a2021-08-17 19:40:00 -050048 return 0;
Ben Tyner9ae5ca42020-02-28 13:13:50 -060049}
50
Ben Tynerb9715172021-09-29 08:46:19 -050051void eventPhalSbeChipop(uint32_t proc)
52{
53 std::cout << "event: sbe timeout proc " << proc << std::endl;
54}
55
Ben Tyner9ae5ca42020-02-28 13:13:50 -060056} // namespace attn