38 StartTiming(
"void reporting::reportManager::PrintCodesAndMessages() ");
41 std::cout <<
"[VerboseLevel] None" << std::endl;
44 std::cout <<
"[VerboseLevel] Info" << std::endl;
47 std::cout <<
"[VerboseLevel] Warning" << std::endl;
50 std::cout <<
"[VerboseLevel] Error" << std::endl;
70 StartTiming(
"void reporting::reportManager::report(ErrorCode message, std::string *vars) ");
74 if (vars ==
nullptr) {
75 std::cerr <<
"[ERROR " << std::setw(3) << std::setfill(
'0') << message <<
"] " <<
ErrorMessages.at(message) << std::endl << std::setfill(
' ');
81 std::string FindWord =
"[tag]";
86 while ((index = s.find(FindWord)) != std::string::npos)
87 s.replace(index, FindWord.length(), vars[counter++]);
89 std::cerr <<
"[ERROR " << std::setw(3) << std::setfill(
'0') << message <<
"] " << s << std::endl << std::setfill(
' ');
98 StartTiming(
"void reporting::reportManager::report(ErrorCode message, char *vars) ");
101 if (vars ==
nullptr) {
102 std::cerr <<
"[ERROR " << std::setw(3) << std::setfill(
'0') << message <<
"] " <<
ErrorMessages.at(message) << std::endl << std::setfill(
' ');
108 std::string FindWord =
"[tag]";
110 std::string Vars = vars;
113 while ((index = s.find(FindWord)) != std::string::npos)
114 s.replace(index, FindWord.length(), Vars);
116 std::cerr <<
"[ERROR " << std::setw(3) << std::setfill(
'0') << message <<
"] " << s << std::endl << std::setfill(
' ');
123 StartTiming(
"void reporting::reportManager::report(WarningCode message, std::string *vars) ");
127 if (vars ==
nullptr) {
128 std::cout <<
"[WARNING " << std::setw(3) << std::setfill(
'0') << message <<
"] " <<
WarningMessages.at(message) << std::endl << std::setfill(
' ');
134 std::string FindWord =
"[tag]";
139 while ((index = s.find(FindWord)) != std::string::npos)
140 s.replace(index, FindWord.length(), vars[counter++]);
142 std::cout <<
"[WARNING " << std::setw(3) << std::setfill(
'0') << message <<
"] " << s << std::endl << std::setfill(
' ');
151 StartTiming(
"void reporting::reportManager::report(WarningCode message, char *vars) ");
154 if (vars ==
nullptr) {
155 std::cout <<
"[WARNING " << std::setw(3) << std::setfill(
'0') << message <<
"] " <<
WarningMessages.at(message) << std::endl << std::setfill(
' ');
161 std::string FindWord =
"[tag]";
163 std::string Vars = vars;
166 while ((index = s.find(FindWord)) != std::string::npos)
167 s.replace(index, FindWord.length(), Vars);
169 std::cout <<
"[WARNING " << std::setw(3) << std::setfill(
'0') << message <<
"] " << s << std::endl << std::setfill(
' ');
176 StartTiming(
"void reporting::reportManager::report(InfoCode message, std::string *vars) ");
180 if (vars ==
nullptr) {
181 std::cout <<
"[INFO " << std::setw(3) << std::setfill(
'0') << message <<
"] " <<
InfoMessages.at(message) << std::endl << std::setfill(
' ');
187 std::string FindWord =
"[tag]";
192 while ((index = s.find(FindWord)) != std::string::npos)
193 s.replace(index, FindWord.length(), vars[counter++]);
195 std::cout <<
"[INFO " << std::setw(3) << std::setfill(
'0') << message <<
"] " << s << std::endl << std::setfill(
' ');
204 StartTiming(
"void reporting::reportManager::report(InfoCode message, char *vars) ");
207 if (vars ==
nullptr) {
208 std::cout <<
"[INFO " << std::setw(3) << std::setfill(
'0') << message <<
"] " <<
InfoMessages.at(message) << std::endl << std::setfill(
' ');
214 std::string FindWord =
"[tag]";
216 std::string Vars = vars;
219 while ((index = s.find(FindWord)) != std::string::npos)
220 s.replace(index, FindWord.length(), Vars);
222 std::cout <<
"[INFO " << std::setw(3) << std::setfill(
'0') << message <<
"] " << s << std::endl << std::setfill(
' ');
static const std::map< WarningCode, const char * > WarningMessages
Class that allows us to centralize all the reporting messages that should be used to inform the user ...
void report(WarningCode message, std::string *vars=nullptr)
Method to report a Warning. It will be displayed if Level is equal or higher to VerboseLevel::WARNI...
1 = Info, warning and error messages
void report(InfoCode message, const char *vars)
Method to report an Info message. It will be displayed if Level is equal or higher to VerboseLevel::...
#define StartTiming(name)
void report(WarningCode message, const char *vars)
Method to report a Warning. It will be displayed if Level is equal or higher to VerboseLevel::WARNIN...
Internal classes to handle reporting to user in several ways. The reporting system is made so a devel...
VerboseLevel Level
Level of Verbosity. The report system won't output messages that are lower than the current level...
VerboseLevel
VerboseLevel used to report messages.
void PrintCodesAndMessages()
Method to print all Info, Warning and Error codes and their respective message. This method is useful...
static const std::map< InfoCode, const char * > InfoMessages
2 = Error and warning messages
void report(ErrorCode message, const char *vars)
Method to report an Error. It will be displayed if Level is equal or higher to VerboseLevel::ERROR.
reporting::reportManager debug
void report(InfoCode message, std::string *vars=nullptr)
Method to report an Info message. It will be displayed if Level is equal or higher to VerboseLevel:...
static const std::map< ErrorCode, const char * > ErrorMessages
void report(ErrorCode message, std::string *vars=nullptr)
Method to report an Error. It will be displayed if Level is equal or higher to VerboseLevel::ERROR...