static void print_output(const std::string & message,bool flag_exception = false ){ #ifndef VALIDATION_ERRORS_LOG if(flag_exception){ throw twml_exception("Validation error occured",message); }else{ ERR_VL << message; } #else // dirty hack to avoid "unused" error in case of compiling with definition on flag_exception = true; if (flag_exception){ ERR_VL << message;} #endif }
void wml_exception( const char* cond , const char* file , const int line , const char *function , const std::string& message , const std::string& dev_message) { std::ostringstream sstr; if(cond) { sstr << "Condition '" << cond << "' failed at "; } else { sstr << "Unconditional failure at "; } sstr << file << ":" << line << " in function '" << function << "'."; if(!dev_message.empty()) { sstr << " Extra development information: " << dev_message; } throw twml_exception(message, sstr.str()); }