Hacker News new | past | comments | ask | show | jobs | submit login

I was trying to find a "turn on backtrace" as an official api but couldn't find one in 90s of looking. I see the backtrace crate for catching them in user space in process, which is nice.

What would you recommend? Forking and execing yourself to set the env var? backtrace::enable_full() or something to that effect would be nice.




fork-exec is probably the most robust way. But having some std API to enable backtraces seems reasonable too. Someone just needs to put in the design work and champion it.

std::backtrace will be stabilized soon. I wonder how far you could get with a custom panic hook that unconditionally captured and printed a backtrace? https://doc.rust-lang.org/std/panic/fn.set_hook.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: