4 ms·
Hmm just adding some ASCII art doesn't really make it pretty. Colorizing the output and making it easier to analyze as well as read, would.
by wkat4242 4y ago
Hmm just adding some ASCII art doesn't really make it pretty. Colorizing the output and making it easier to analyze as well as read, would.
- estebank 4y agoThe article wasn't about adding ASCII art, only about allowing the default panic handler to print the output correctly when the application uses raw mode in the terminal. It is a good introduction to what registering a panic handler looks like, no more than that. If you want colored backtraces, you can look at https://crates.io/crates/color-backtrace https://crates.io/crates/color-backtrace, https://crates.io/crates/better-panic https://crates.io/crates/better-panic or https://crates.io/crates/color-eyre https://crates.io/crates/color-eyre, which leverage the same machinery shown in the article.
- kaelinl 4y agoIn this article, I interpret "pretty" to mean "readable". There is a sample of the alternative in the post. Raw mode requires an explicit carriage return to accompany each line feed if you want the CR behavior, so if the default panic handler prints its normal string, each line is horizontally indented to the end of the previous line. There is no ASCII art.
- wkat4242 4y agoOk then I misunderstood, I was going by the ASCII art in the picture. I don't know much about Rust so I didn't really get the whole story.