mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
feat(Core/Debugging): Allow to show a message when aborting (#5228)
This commit is contained in:
@@ -56,7 +56,6 @@ namespace
|
||||
|
||||
namespace acore
|
||||
{
|
||||
|
||||
void Assert(char const* file, int line, char const* function, std::string const& debugInfo, char const* message)
|
||||
{
|
||||
std::string formattedMessage = acore::StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + debugInfo + '\n';
|
||||
@@ -116,6 +115,20 @@ namespace acore
|
||||
Crash(formattedMessage.c_str());
|
||||
}
|
||||
|
||||
void Abort(char const* file, int line, char const* function, char const* message, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, message);
|
||||
|
||||
std::string formattedMessage = StringFormat("\n%s:%i in %s ABORTED:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
|
||||
Crash(formattedMessage.c_str());
|
||||
}
|
||||
|
||||
void AbortHandler(int sigval)
|
||||
{
|
||||
// nothing useful to log here, no way to pass args
|
||||
|
||||
Reference in New Issue
Block a user