flush logs on all asserts

This commit is contained in:
2026-08-21 23:01:25 +02:00
parent 8a36af6bcb
commit 33331ea529
@@ -17,16 +17,27 @@
#include <csignal>
#endif
#define BIGFOOT_FLUSH_LOG \
do \
{ \
if (Bigfoot::Singleton<Bigfoot::Log>::HasInstance()) \
{ \
Bigfoot::Singleton<Bigfoot::Log>::GetInstance().Flush(); \
} \
} while (false)
#if defined BIGFOOT_WINDOWS
#define BREAK \
do \
{ \
BIGFOOT_FLUSH_LOG; \
__debugbreak(); \
} while (false)
#elif defined BIGFOOT_LINUX
#define BREAK \
do \
{ \
BIGFOOT_FLUSH_LOG; \
std::raise(SIGTRAP); \
} while (false)
#endif
@@ -60,10 +71,6 @@
if (!(p_assert)) [[unlikely]] \
{ \
HANDLER::Handle(location, p_message __VA_OPT__(, ) __VA_ARGS__); \
if (Bigfoot::Singleton<Bigfoot::Log>::HasInstance()) \
{ \
Bigfoot::Singleton<Bigfoot::Log>::GetInstance().Flush(); \
} \
BREAK; \
std::abort(); \
} \