Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Canceled after 0s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Canceled after 0s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Canceled after 0s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Canceled after 0s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Canceled after 0s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Canceled after 0s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Canceled after 0s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Canceled after 0s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Canceled after 0s
Bigfoot / Clang Format Checks (push) Canceled after 0s
Bigfoot / Sonarqube (push) Skipped
54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
/*********************************************************************
|
|
* \file AssertHandler.hpp
|
|
*
|
|
* \author Romain BOULLARD
|
|
* \date August 2026
|
|
*********************************************************************/
|
|
#ifndef BIGFOOT_UTILS_ASSERTHANDLER_HPP
|
|
#define BIGFOOT_UTILS_ASSERTHANDLER_HPP
|
|
#include <Utils/Assert/Assert.hpp>
|
|
#include <Utils/Log/Log.hpp>
|
|
|
|
#if defined BIGFOOT_NOT_OPTIMIZED
|
|
|
|
#include <format>
|
|
#include <source_location>
|
|
|
|
namespace Bigfoot
|
|
{
|
|
template<Log::LoggerInfo& LOGGER>
|
|
class AssertHandler
|
|
{
|
|
public:
|
|
AssertHandler() = delete;
|
|
|
|
AssertHandler(const AssertHandler& p_handler) = delete;
|
|
AssertHandler(AssertHandler&& p_handler) = delete;
|
|
|
|
~AssertHandler() = delete;
|
|
|
|
/**
|
|
* Handle an assertion.
|
|
*
|
|
* \param p_location Location of the assertion.
|
|
* \param p_format Format string for the assertion message.
|
|
* \param p_args Arguments for the format string.
|
|
*/
|
|
template<typename... ARGS>
|
|
static void Handle(const std::source_location& p_location, std::format_string<ARGS...> p_format, ARGS&&... p_args)
|
|
{
|
|
BIGFOOT_LOG_FATAL(LOGGER,
|
|
"Assert: {} (File:{}, Line:{}, Function:{}\n",
|
|
std::format(p_format, std::forward<ARGS>(p_args)...),
|
|
p_location.file_name(),
|
|
p_location.line(),
|
|
p_location.function_name());
|
|
}
|
|
|
|
AssertHandler& operator=(const AssertHandler& p_handler) = delete;
|
|
AssertHandler& operator=(AssertHandler&& p_handler) = delete;
|
|
};
|
|
} // namespace Bigfoot
|
|
#endif
|
|
#endif
|