Closed prasannavl closed 6 years ago
This sounds reasonable to me!
Alternatively we could only set up the panic handler if compiled in release mode.
Alternatively we could only set up the panic handler if compiled in release mode.
That's not a bad idea! This is most likely in line with what people would want, behavior-wise anyway. Guess that might be another one for the 2.0 list?
@spacekookie Well, does it have to be "alternatively"? :)
How about:
RUST_BACKTRACE
is present - backoff - let the environment take over.We'd need to document this well enough that people don't get confused but yea, that's not a bad workflow!
This has now landed in master
Ok, looks like this has still not made it to a release. Could we may be add an optional flag into the macro in a non-breaking way to get this without waiting on a full blown release?
Currently the
setup_panic!
macro sets itself up unconditionally. I think a good default would be to ignore itself ifRUST_BACKTRACE
is setup up explicitly - that way it's not intended for normal humans, but for an environment that already expects the standard rust backtraces, or for developers who explicitly want to turn this on.This also makes it immensely useful by default during debugging, and development, as there's no need to wrap the setup_panic around a condition. I like the one setup, and would like to avoid putting an ugly wrapper around it. Clearly, this is not something intended during the development process.
Hopefully, most people feel the same, and this can be the default behavior! :)