debug-message 1.2.0

Print debug messages if the DEBUG environment variable is set
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use debug_message::debug;

#[derive(Debug)]
struct Struct1 {
    string: String
}

fn main() {
    debug("this will be printed only if the DEBUG environment variable is set");

    let number = 123;
    debug(&format!("{}", number));

    let example_struct = Struct1 { string: String::from("string") };
    debug(&format!("{:?}, field: {}", example_struct, example_struct.string));
}