30# include <itpp/config.h>
32# include <itpp/config_msvc.h>
45static bool warnings_enabled =
true;
46static bool file_line_info_enabled =
true;
47static std::ostream *warn = &std::cerr;
52 std::ostringstream
error;
54 error <<
"*** Assertion failed in " <<
file <<
" on line " <<
line
55 <<
":\n" <<
msg <<
" (" <<
ass <<
")\n";
60 std::cerr <<
error.str() << std::flush;
62 throw std::runtime_error(
error.str());
70 std::ostringstream
error;
72 error <<
"*** Error in " <<
file <<
" on line " <<
line <<
":\n"
78 std::cerr <<
error.str() << std::flush;
80 throw std::runtime_error(
error.str());
88 std::cerr <<
msg << std::flush;
95 (*warn) <<
"*** Warning in " <<
file <<
" on line " <<
line <<
":\n"
96 <<
msg << std::endl << std::flush;
99 (*warn) <<
msg << std::endl << std::flush;
void it_disable_warnings()
Disable warnings.
error_msg_style
Style of assert, error and warning messages.
void it_enable_warnings()
Enable warnings.
void it_warning_f(std::string msg, std::string file, int line)
Helper function for the it_warning macro.
void it_error_msg_style(error_msg_style style)
Set preferred style of assert, error and warning messages.
void it_error_f(std::string msg, std::string file, int line)
Helper function for the it_error and it_error_if macros.
void it_redirect_warnings(std::ostream *warn_stream)
Redirect warnings to the ostream warn_stream.
void it_assert_f(std::string ass, std::string msg, std::string file, int line)
Helper function for the it_assert and it_assert_debug macros.
void it_info_f(std::string msg)
Helper function for the it_info and it_info_debug macros.
Error handling functions - header file.