Hacker News new | ask | show | jobs
by wkat4242 1216 days 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.
2 comments

The 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/better-panic or https://crates.io/crates/color-eyre, which leverage the same machinery shown in the article.
In 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.

Ok 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.