Crate logchop[][src]

Log your Result and Option chains with inline methods.

First, import all traits:

use logchop::*;

This will extend Option and Result with new methods. Now you can turn:

return match maybe_something {
    Some(x) => Some(x),
    None => {
        debug!("Nothing found!");
        None
    }
}

into

return maybe_something.debug_none("Nothing found!")

😗🤌

The full list of methods exposed are available on the respective types

Traits

OptionLogFormatter

Augment Option types with log methods that can print abitrary representations of wrapped values.

OptionLogger

Augment Option types with log methods that can print debug representations of wrapped values.

ResultLogFormatter

Augment Result types with log methods that can print abitrary representations of wrapped values.

ResultLogger

Augment Result types with log methods that can print debug representations of wrapped values.