diff --git a/deps/ox/src/ox/std/assert.cpp b/deps/ox/src/ox/std/assert.cpp index 27f0c53e..7dd7b9c5 100644 --- a/deps/ox/src/ox/std/assert.cpp +++ b/deps/ox/src/ox/std/assert.cpp @@ -6,10 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#if defined(OX_USE_STDLIB) -#include -#endif - #include "stacktrace.hpp" #include "trace.hpp" @@ -20,13 +16,13 @@ namespace ox { void panic([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_unused]]const char *panicMsg, [[maybe_unused]]const Error &err) noexcept { #ifdef OX_USE_STDLIB if (!std::is_constant_evaluated()) { - std::cerr << "\033[31;1;1mPANIC:\033[0m (" << file << ':' << line << "): " << panicMsg << '\n'; + oxErrf("\033[31;1;1mPANIC:\033[0m [{}:{}]: {}\n", file, line, panicMsg); if (err.msg) { - std::cerr << "\tError Message:\t" << err.msg << '\n'; + oxErrf("\tError Message:\t{}\n", err.msg); } - std::cerr << "\tError Code:\t" << err << '\n'; + oxErrf("\tError Code:\t{}\n", static_cast(err)); if (err.file != nullptr) { - std::cerr << "\tError Location:\t" << err.file << ':' << err.line << '\n'; + oxErrf("\tError Location:\t{}:{}\n", err.file, err.line); } printStackTrace(2); oxTrace("panic").del("") << "Panic: " << panicMsg << " (" << file << ":" << line << ")"; diff --git a/deps/ox/src/ox/std/assert.hpp b/deps/ox/src/ox/std/assert.hpp index 7eb15b4f..5f336090 100644 --- a/deps/ox/src/ox/std/assert.hpp +++ b/deps/ox/src/ox/std/assert.hpp @@ -36,12 +36,9 @@ constexpr void assertFunc(const char *file, int line, bool pass, [[maybe_unused] if (!pass) { if (!std::is_constant_evaluated()) { #ifdef OX_USE_STDLIB - std::cerr << "\033[31;1;1mASSERT FAILURE:\033[0m " << assertTxt << " [" << file << ':' << line << "]: " - << msg << std::endl; + oxErrf("\033[31;1;1mASSERT FAILURE:\033[0m [{}:{}]: {}\n", file, line, msg); printStackTrace(2); - oxTrace("assert").del("") << "Failed assert: " << msg << " (" << assertTxt << ") " << " [" << file - << ":" - << line << "]"; + oxTracef("assert", "Failed assert: {} ({}) [{}:{}]", msg, assertTxt, file, line); std::abort(); #else constexprPanic(file, line, msg); @@ -56,16 +53,16 @@ constexpr void assertFunc(const char *file, int line, const Error &err, const ch if (err) { if (!std::is_constant_evaluated()) { #if defined(OX_USE_STDLIB) - std::cerr << "\033[31;1;1mASSERT FAILURE:\033[0m (" << file << ':' << line << "): " << assertMsg << '\n'; + oxErrf("\033[31;1;1mASSERT FAILURE:\033[0m [{}:{}]: {}\n", file, line, assertMsg); if (err.msg) { - std::cerr << "\tError Message:\t" << err.msg << '\n'; + oxErrf("\tError Message:\t{}\n", err.msg); } - std::cerr << "\tError Code:\t" << err << '\n'; + oxErrf("\tError Code:\t{}\n", static_cast(err)); if (err.file != nullptr) { - std::cerr << "\tError Location:\t" << err.file << ':' << err.line << '\n'; + oxErrf("\tError Location:\t{}:{}\n", err.file, err.line); } printStackTrace(2); - oxTrace("constexprPanic").del("") << "Panic: " << assertMsg << " [" << file << ":" << line << "]"; + oxTracef("assert", "Failed assert: {} [{}:{}]", assertMsg, file, line); std::abort(); #else constexprPanic(file, line, assertMsg);