Fix empty lines being added for errors with no script backtrace
This commit is contained in:
@ -183,7 +183,9 @@ static void handle_crash(int sig) {
|
||||
}
|
||||
if (!script_backtraces.is_empty()) {
|
||||
for (const Ref<ScriptBacktrace> &backtrace : script_backtraces) {
|
||||
print_error(backtrace->format());
|
||||
if (!backtrace->is_empty()) {
|
||||
print_error(backtrace->format());
|
||||
}
|
||||
}
|
||||
print_error("-- END OF SCRIPT BACKTRACE --");
|
||||
print_error("================================================================");
|
||||
|
||||
@ -84,8 +84,10 @@ void MacOSTerminalLogger::log_error(const char *p_function, const char *p_file,
|
||||
}
|
||||
|
||||
for (const Ref<ScriptBacktrace> &backtrace : p_script_backtraces) {
|
||||
os_log_error(OS_LOG_DEFAULT, "%{public}s", backtrace->format().utf8().get_data());
|
||||
logf_error("\E[0;90m%s\E[0m\n", backtrace->format(strlen(indent)).utf8().get_data());
|
||||
if (!backtrace->is_empty()) {
|
||||
os_log_error(OS_LOG_DEFAULT, "%{public}s", backtrace->format().utf8().get_data());
|
||||
logf_error("\E[0;90m%s\E[0m\n", backtrace->format(strlen(indent)).utf8().get_data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user