rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Color the `dbg!()` macro

Open amab8901 opened this issue 6 months ago • 4 comments

I found this cool crate that offers a colored version of dbg!() called color!().

Unfortunately, it doesn't integrate with all other crates because most people aren't aware of this crate so they haven't added an integration for it. And orphan rule doesn't let me easily create a custom impl for those crates.

Would be really nice if we had colored dbg!() output in the dbg!() macro (or perhaps create another macro for colored debug output, or via println!(), or something like that). It's especially helpful when dealing with complex nested structs by letting me find what I'm looking for more easily/conveniently.

This proposal received lots of positive feedback in the internals forum, so I'm copying it over to this RFC.

amab8901 avatar Aug 15 '24 19:08 amab8901