Log before std::abort

This commit is contained in:
2026-01-28 18:56:28 +01:00
parent e78d648178
commit 1775e864b4
4 changed files with 33 additions and 2 deletions
@@ -4,8 +4,9 @@
* \author Romain BOULLARD
* \date October 2025
*********************************************************************/
#ifndef BIGFOOT_UTILS_ASSERT_HPP
#define BIGFOOT_UTILS_ASSERT_HPP
#ifndef BIGFOOT_SYSTEM_ASSERT_HPP
#define BIGFOOT_SYSTEM_ASSERT_HPP
#include <System/Log/Log.hpp>
#if defined BIGFOOT_NOT_OPTIMIZED
@@ -79,6 +80,10 @@
}; \
\
HANDLER::Handle(location, stacktrace(), p_message __VA_OPT__(, ) __VA_ARGS__); \
if (Bigfoot::Singleton<Bigfoot::Log>::HasInstance()) \
{ \
Bigfoot::Singleton<Bigfoot::Log>::Instance().Flush(); \
} \
BREAK; \
std::abort(); \
} \
@@ -35,6 +35,16 @@ class Singleton
return *eastl::bit_cast<TYPE*>(ms_instance.data());
}
/**
* Is the instance initialized
*
* \return True if initialized, false otherwise
*/
static constexpr bool HasInstance()
{
return ms_initialized;
}
class Lifetime
{
public: