typed_log 0.1.0

Logging shouldn't be limited to text.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use typed_log::{Loggable, log_any};

pub struct MyCustomStruct {
    pub to_log: String,
}

impl Loggable for MyCustomStruct {}

fn logger(my_struct: &MyCustomStruct) {
    println!("{}", my_struct.to_log);
}
fn main() {
    typed_log::push_log_impl(&logger);

    log_any(&MyCustomStruct {
        to_log: "inner value".to_string(),
    });
}