21 #define GETTEXT_DOMAIN "wesnoth-lib"
31 #define WRN_NG LOG_STREAM(warn, log_engine)
34 #define ERR_WML LOG_STREAM(err, log_wml)
40 ,
const char *
function
41 ,
const std::string& message
42 ,
const std::string& dev_message)
44 std::ostringstream sstr;
46 sstr <<
"Condition '" << cond <<
"' failed at ";
48 sstr <<
"Unconditional failure at ";
51 sstr << file <<
":" <<
line <<
" in function '" <<
function <<
"'.";
53 if(!dev_message.empty()) {
54 sstr <<
" Extra development information: " << dev_message;
62 std::ostringstream sstr;
66 sstr <<
_(
"An error due to possibly invalid WML occurred\nThe error message is :")
68 <<
_(
"When reporting the bug please include the following error message :")
75 const std::string §ion
76 ,
const std::string &key
77 ,
const std::string& primary_key
78 ,
const std::string& primary_value)
81 if(!section.empty()) {
82 if(section[0] ==
'[') {
83 symbols[
"section"] = section;
86 <<
" parameter 'section' should contain brackets."
88 symbols[
"section"] =
"[" + section +
"]";
92 if(!primary_key.empty()) {
93 assert(!primary_value.empty());
95 symbols[
"primary_key"] = primary_key;
96 symbols[
"primary_value"] = primary_value;
98 return VGETTEXT(
"In section '[$section|]' where '$primary_key| = "
99 "$primary_value' the mandatory key '$key|' isn't set.", symbols);
101 return VGETTEXT(
"In section '[$section|]' the "
102 "mandatory key '$key|' isn't set.", symbols);
static std::string _(const char *str)
Standard logging facilities (interface).
void line(int from_x, int from_y, int to_x, int to_y)
Draw a line.
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
std::map< std::string, t_string > string_map
Helper class, don't construct this directly.
void show() const
Shows the error in a dialog.
std::string dev_message
The message for developers telling which problem was triggered, this shouldn't be translated.
std::string user_message
The message for the user explaining what went wrong.
void throw_wml_exception(const char *cond, const char *file, const int line, const char *function, const std::string &message, const std::string &dev_message)
Helper function, don't call this directly.
static lg::log_domain log_engine("engine")
std::string missing_mandatory_wml_key(const std::string §ion, const std::string &key, const std::string &primary_key, const std::string &primary_value)
Returns a standard message for a missing wml key.
static lg::log_domain log_wml("wml")
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...