31 what_type_msg_(
"Program Error: Violated assert! ") {}
36 out << std::endl <<
"> In file: " <<
file_name_ <<
"(" <<
line_ <<
"): Throw in function " <<
function_ << std::endl;
37 out <<
"> Expression: \'" <<
expression_ <<
"\'" <<
"\n";
39 out <<
"> Values:" << std::endl;
41 out <<
" " << val << std::endl;
54 converter <<
"--------------------------------------------------------" << std::endl;
59 converter << std::endl <<
"--------------------------------------------------------" << std::endl;
72 std::cerr << exception_.what();
80 exception_.file_name_ = std::string(file_name);
81 exception_.function_ = std::string(
function);
82 exception_.line_ =
line;
90 exception_.what_type_msg_ += error_msg;
99 std::ostringstream info_str, stack_str;
100 exception_.print_info(info_str);
101 exception_.print_stacktrace(stack_str);
Class defining debugging messages.
void warning(std::string warning_msg="")
Generate warning with given message.
void print_info(std::ostringstream &out) const override
Print formatted assert message.
std::string function_
Actual function.
static StreamMask log
Predefined mask of log file output.
std::string file_name_
Actual file.
std::string expression_
Assertion expression.
std::vector< std::string > current_val_
Formated strings of names and values of given variables.
void error(std::string error_msg="")
Generate error with given message.
std::string what_type_msg() const override
Override ExceptionBase::what_type_msg()
#define WarningOut()
Macro defining 'warning' record of log.
std::ostringstream & form_message(std::ostringstream &) const override
Override ExceptionBase::form_message()
std::string what_type_msg_
String representation of message type (Program error, Warning, ...)
void print_stacktrace(std::ostream &out) const
Prints formated stacktrace into given stream out.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Assert & set_context(const char *file_name, const char *function, const int line)
Stores values for printing out line number, function, etc.