mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
rework windows crash handler
* use -Ofast -fomit-frame-pointer for release * new windows crash handler that can generate backtraces reports * fix crash after fatal errors
This commit is contained in:
@@ -28,6 +28,10 @@ Logger g_logger;
|
||||
|
||||
void Logger::log(Fw::LogLevel level, const std::string& message)
|
||||
{
|
||||
static bool ignoreLogs = false;
|
||||
if(ignoreLogs)
|
||||
return;
|
||||
|
||||
const static std::string logPrefixes[] = { "", "", "WARNING: ", "ERROR: ", "FATAL ERROR: " };
|
||||
|
||||
std::string outmsg = logPrefixes[level] + message;
|
||||
@@ -41,6 +45,7 @@ void Logger::log(Fw::LogLevel level, const std::string& message)
|
||||
|
||||
if(level == Fw::LogFatal) {
|
||||
g_window.displayFatalError(message);
|
||||
ignoreLogs = true;
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user