Help optimize out backtraces when disabled

This commit is contained in:
Kornel
2022-01-17 02:17:25 +00:00
parent bd3cb52565
commit c2807525a5
2 changed files with 19 additions and 8 deletions

View File

@@ -263,7 +263,7 @@ fn default_hook(info: &PanicInfo<'_>) {
// If this is a double panic, make sure that we print a backtrace
// for this panic. Otherwise only print it if logging is enabled.
let backtrace_env = if panic_count::get_count() >= 2 {
RustBacktrace::Print(crate::backtrace_rs::PrintFmt::Full)
backtrace::rust_backtrace_print_full()
} else {
backtrace::rust_backtrace_env()
};