/* [<][>][^][v][top][bottom][index][help] */
DEFINITIONS
This source file includes following definitions.
- record
- record_error
- record_warning
- record_info
- record_benchmark
1 #include "utility/record.hpp"
2
3 using namespace std;
4
5 void
6 record( record_t record_type
7 , const string & file_name
8 , const string & function_name
9 , const unsigned int line_number
10 , const string & message
11 )
12 {
13 switch(record_type)
14 {
15 case record_t::ERROR : record_error( file_name
16 , function_name
17 , line_number
18 , message
19 );
20 break;
21 case record_t::WARNING : record_warning( file_name
22 , function_name
23 , line_number
24 , message
25 );
26 break;
27 case record_t::INFO : record_info( file_name
28 , function_name
29 , line_number
30 , message
31 );
32 break;
33 default : break;
34 }
35
36 }
37
38 void
39 record_error( const string & file_name
40 , const string & function_name
41 , const unsigned int line_number
42 , const string & message
43 )
44 {
45 cerr << "[ERROR]";
46 cerr << "-";
47 cerr << "[" + file_name + "]";
48 cerr << "-";
49 cerr << "[" + function_name + "]";
50 cerr << "-";
51 cerr << "[" + to_string(line_number) + "]";
52 cerr << "-";
53 cerr << message;
54 cerr << endl;
55 }
56
57 void
58 record_warning( const string & file_name
59 , const string & function_name
60 , const unsigned int line_number
61 , const string & message
62 )
63 {
64 cout << "[WARNING]";
65 cout << "-";
66 cout << "[" + file_name + "]";
67 cout << "-";
68 cout << "[" + function_name + "]";
69 cout << "-";
70 cout << "[" + to_string(line_number) + "]";
71 cout << "-";
72 cout << message;
73 cout << endl;
74 }
75
76 void
77 record_info( const string & file_name
78 , const string & function_name
79 , const unsigned int line_number
80 , const string & message
81 )
82 {
83 cout << "[INFO]";
84 cout << "-";
85 cout << "[" + file_name + "]";
86 cout << "-";
87 cout << "[" + function_name + "]";
88 cout << "-";
89 cout << "[" + to_string(line_number) + "]";
90 cout << "-";
91 cout << message;
92 cout << endl;
93 }
94
95 void
96 record_benchmark()
97 {
98
99 }