Crate better_debug

source ·
Expand description

Drop-in replacement for #[derive(Debug)]

Have you used #[derive(Debug)] on a struct? Well, you’ve probably noticed that it prints out all the fields of the struct, even the ones that you don’t want to print out. If you have a Vec<T> in your struct, forget about printing it because that will clutter the logs very badly.

Or maybe you just want to customize the name of a field, or avoid printing it completely?

Look no more! BetterDebug is a drop-in replacement for #[derive(Debug)] that allows you to customize the behavior of the Debug macro.

This crate provides an extremely simple, fast, efficient and no-overhead replacement for the standard library’s Debug macro. BetterDebug allows you to skip fields from being printed, mark them as a secret, use a custom formatter, etc.

Please see the documentation below for usage instructions.

Derive Macros