Closed matthiasbeyer closed 1 year ago
In general, it depends on how early you're willing to print a human-readable panic. If you set it later into your program's logic, then you could possibly have a panic which doesn't use this library's panic hook - meaning the message will just be "panicking because of thing hahah!"
For that reason, most people will want to put it in their program's entrypoint. For almost all Rust binaries, that'll be somewhere at the top of main()
, or even as the first line of main. Again, the earlier you set the hook, the more clear-cut (and reportable) panics will be to your users.
I hope that helps! If you have any other questions, please let me know! :)
Choose one: is this a 🐛 bug report
Missing docs are a bug, right? :laughing:
So what I am missing is just a short explanation where to call the
setup_panic!()
macro, actually: Insidemain
? Outside of any function? Just a bit of confusion on my end because the docs do not show where to put the call.Thanks for this nice crate!