assert/logging: Stop the logging thread and flush the backends before crashing (#7146)
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/logging/backend.h"
|
||||
#include "common/logging/log.h"
|
||||
|
||||
// For asserts we'd like to keep all the junk executed when an assert happens away from the
|
||||
@ -17,6 +18,7 @@
|
||||
if (!(_a_)) [[unlikely]] { \
|
||||
[]() CITRA_NO_INLINE CITRA_NO_RETURN { \
|
||||
LOG_CRITICAL(Debug, "Assertion Failed!"); \
|
||||
Common::Log::Stop(); \
|
||||
Crash(); \
|
||||
exit(1); \
|
||||
}(); \
|
||||
@ -28,6 +30,7 @@
|
||||
if (!(_a_)) [[unlikely]] { \
|
||||
[&]() CITRA_NO_INLINE CITRA_NO_RETURN { \
|
||||
LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); \
|
||||
Common::Log::Stop(); \
|
||||
Crash(); \
|
||||
exit(1); \
|
||||
}(); \
|
||||
@ -37,6 +40,7 @@
|
||||
#define UNREACHABLE() \
|
||||
([]() CITRA_NO_INLINE CITRA_NO_RETURN { \
|
||||
LOG_CRITICAL(Debug, "Unreachable code!"); \
|
||||
Common::Log::Stop(); \
|
||||
Crash(); \
|
||||
exit(1); \
|
||||
}())
|
||||
@ -44,6 +48,7 @@
|
||||
#define UNREACHABLE_MSG(...) \
|
||||
([&]() CITRA_NO_INLINE CITRA_NO_RETURN { \
|
||||
LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); \
|
||||
Common::Log::Stop(); \
|
||||
Crash(); \
|
||||
exit(1); \
|
||||
}())
|
||||
|
Reference in New Issue
Block a user