mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
troubleshooter: deferred message for fatal errors (#491)
## Description of change When the game logs a fatal error message, queue up a deferred message for the troubleshooter.
This commit is contained in:
@@ -1234,6 +1234,7 @@ namespace avs {
|
|||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
new_style = logger::Style::RED;
|
new_style = logger::Style::RED;
|
||||||
|
deferredlogs::report_fatal_message();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
position = 0;
|
position = 0;
|
||||||
@@ -1302,6 +1303,7 @@ namespace avs {
|
|||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
style = logger::Style::RED;
|
style = logger::Style::RED;
|
||||||
|
deferredlogs::report_fatal_message();
|
||||||
break;
|
break;
|
||||||
case 'W':
|
case 'W':
|
||||||
style = logger::Style::YELLOW;
|
style = logger::Style::YELLOW;
|
||||||
|
|||||||
@@ -32,6 +32,16 @@ namespace deferredlogs {
|
|||||||
deferred_errors.emplace_back(messages);
|
deferred_errors.emplace_back(messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void report_fatal_message() {
|
||||||
|
static std::once_flag printed;
|
||||||
|
std::call_once(printed, []() {
|
||||||
|
deferredlogs::defer_error_messages({
|
||||||
|
"game reported FATAL error(s)",
|
||||||
|
" look for messages containing F: in the log",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void dump_to_logger(bool is_crash) {
|
void dump_to_logger(bool is_crash) {
|
||||||
static std::once_flag printed;
|
static std::once_flag printed;
|
||||||
std::call_once(printed, [is_crash]() {
|
std::call_once(printed, [is_crash]() {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ namespace deferredlogs {
|
|||||||
extern const std::initializer_list<std::string> SUPERSTEP_SOUND_ERROR_MESSAGE;
|
extern const std::initializer_list<std::string> SUPERSTEP_SOUND_ERROR_MESSAGE;
|
||||||
|
|
||||||
void set_softid(const std::string& softid);
|
void set_softid(const std::string& softid);
|
||||||
|
void report_fatal_message();
|
||||||
void defer_error_messages(std::initializer_list<std::string> messages);
|
void defer_error_messages(std::initializer_list<std::string> messages);
|
||||||
void dump_to_logger(bool is_crash=false);
|
void dump_to_logger(bool is_crash=false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user