#string #debugging #format-string #output-format #print #printed #life

prettier-print

🌈 Prettier-printed debug strings 🌈

3 releases

0.1.2 Aug 1, 2021
0.1.1 Jul 31, 2021
0.1.0 Jul 31, 2021

#4 in #printed

Download history 2/week @ 2024-09-23 70/week @ 2024-12-02 95/week @ 2024-12-09

165 downloads per month

MIT license

1.5MB
570 lines

Latest version Documentation

I'm not a fan of the built-in "pretty-printed" debug output (format string "{:#?}") because they don't look so pretty to me. That is why I made this crate.

prettier-print contains two modules. The first is prettier_printer which adds rainbows and stars to the debug string.

Drake meme

// How to use PrettierPrinter
println!("{}", PrettierPrinter::default().print(&variable));

sparkles prints the debug string, and then runs game of life on top of the printed string.

https://user-images.githubusercontent.com/36318069/127730094-cbd2884c-3aa4-4084-addd-3536aec43278.mp4

let stdout = stdout();
Sparkles::new(stdout.lock()).run(&variable)?;

Dependencies

~3MB
~57K SLoC