hackerlog 0.2.0

A simple logging tool with no fluff for hackers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use hackerlog::*;
use std::fs::File;

fn main() -> std::io::Result<()> {
    // First log to stdout
    info!("This goes to terminal");

    // Redirect to a file
    let log_file = File::create("test.log")?;
    logger().set_writer(Box::new(log_file))?;

    info!("This goes to test.log");
    warn!("This warning also goes to test.log");

    Ok(())
}