impr: Properly print asserts

This commit is contained in:
WerWolv
2023-07-23 23:39:00 +02:00
parent ffdaf0d16e
commit 8b3cd2d76d
2 changed files with 16 additions and 0 deletions

View File

@@ -42,4 +42,14 @@ namespace hex::log::impl {
return logEntries;
}
void assertionHandler(bool expr, const char* expr_str, const char* file, int line) {
if (!expr) {
log::error("Assertion failed: {} at {}:{}", expr_str, file, line);
#if defined (DEBUG)
std::abort();
#endif
}
}
}