blob: 4adb5af195824c09c73fc9e373ab33acd5ff1f45 [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 Tynerb1ebfcb2020-05-08 18:52:48 -050045void eventVital()
46{
47 std::cout << "event: vital" << std::endl;
Ben Tyner9ae5ca42020-02-28 13:13:50 -060048}
49
50} // namespace attn