[ox/std] Add log message for asserts
This commit is contained in:
parent
7b034be393
commit
806eaa229a
3
deps/ox/src/ox/std/assert.cpp
vendored
3
deps/ox/src/ox/std/assert.cpp
vendored
@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
#include "stacktrace.hpp"
|
#include "stacktrace.hpp"
|
||||||
|
#include "trace.hpp"
|
||||||
|
|
||||||
#include "assert.hpp"
|
#include "assert.hpp"
|
||||||
|
|
||||||
namespace ox {
|
namespace ox {
|
||||||
@ -23,6 +25,7 @@ void assertFunc<bool>([[maybe_unused]]const char *file, [[maybe_unused]]int line
|
|||||||
if (!pass) {
|
if (!pass) {
|
||||||
std::cerr << "\033[31;1;1mASSERT FAILURE:\033[0m (" << file << ':' << line << "): " << msg << std::endl;
|
std::cerr << "\033[31;1;1mASSERT FAILURE:\033[0m (" << file << ':' << line << "): " << msg << std::endl;
|
||||||
printStackTrace(2);
|
printStackTrace(2);
|
||||||
|
oxTrace("assert").del("") << "Failed assert: " << msg << " (" << file << ":" << line << ")";
|
||||||
std::abort();
|
std::abort();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user