[ox/std] Make oxErr not automatically print new line to stderr
This commit is contained in:
parent
efe61bab6f
commit
5c28cef726
2
deps/ox/src/ox/std/stacktrace.cpp
vendored
2
deps/ox/src/ox/std/stacktrace.cpp
vendored
@ -52,7 +52,7 @@ void printStackTrace([[maybe_unused]]unsigned shave) noexcept {
|
||||
#if defined(OX_USE_STDLIB) && __has_include(<unistd.h>)
|
||||
Vector<void*> frames(1000);
|
||||
frames.resize(static_cast<std::size_t>(backtrace(frames.data(), frames.size())));
|
||||
if (frames.size() > shave) {
|
||||
if (frames.size() - shave > 2) {
|
||||
const auto symbols = backtrace_symbols(frames.data() + shave, frames.size() - shave);
|
||||
const auto symbolicatedStacktrace = symbolicate(bit_cast<const char**>(frames.data() + shave), frames.size() - shave, "\t");
|
||||
free(symbols);
|
||||
|
2
deps/ox/src/ox/std/tracehook.cpp
vendored
2
deps/ox/src/ox/std/tracehook.cpp
vendored
@ -34,7 +34,7 @@ void oxTraceHook([[maybe_unused]] const char *file, [[maybe_unused]] int line,
|
||||
} else if (ox_strcmp(ch, "stdout") == 0) {
|
||||
std::cout << msg;
|
||||
} else if (ox_strcmp(ch, "stderr") == 0) {
|
||||
std::cerr << msg << '\n';
|
||||
std::cerr << msg;
|
||||
} else if (ox_strcmp(ch, "error") == 0) {
|
||||
std::cerr << "\033[31;1;1mERROR:\033[0m (" << file << ':' << line << "): " << msg << '\n';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user