Responsible for errors handling.
More...
#include <managers/io/ErrorManager.h>
|
| static void | assertMsg (const bool expression, const std::string &message, const char *file, const char *func, const int line) |
| | Prints error message and terminates the program.
|
Responsible for errors handling.
Definition at line 26 of file ErrorManager.h.
◆ ErrorManager()
| gpr::io::ErrorManager::ErrorManager |
( |
| ) |
|
|
inline |
◆ ~ErrorManager()
| gpr::io::ErrorManager::~ErrorManager |
( |
| ) |
|
|
inline |
◆ assertMsg()
| void gpr::io::ErrorManager::assertMsg |
( |
const bool | expression, |
|
|
const std::string & | message, |
|
|
const char * | file, |
|
|
const char * | func, |
|
|
const int | line ) |
|
inlinestatic |
Prints error message and terminates the program.
- Parameters
-
| expression | Condition that must hold. |
| message | Error message written when expression is false. |
| file | Source file containing the assertion. |
| func | Function name. |
| line | Line number. |
Definition at line 52 of file ErrorManager.h.
55 {
56 if (!expression) {
57 std::cerr <<
"[ " << file <<
"]::" << func <<
"::" <<
line <<
" "
58 << message << "\n";
59 exit(1);
60 }
61 }
std::string line(const std::string &topic, const std::vector< Field > &fields)
◆ operator<<()
template<typename T>
| ErrorManager & gpr::io::ErrorManager::operator<< |
( |
const T & | data | ) |
|
|
inline |
Writes data to the log.
- Parameters
-
- Returns
- Reference to this.
Definition at line 37 of file ErrorManager.h.
38 {
39
40 std::cerr << data;
41 return *this;
42 }
The documentation for this class was generated from the following file: