rusty-logger 0.3.0

A modular and simple logger for rust
Documentation
#[cfg(test)]
mod tests {
    use crate::Logger;

    #[test]
    fn log() {
        let x = 30;
        let mut logger = Logger::new("MAIN", std::io::stdout());
        logger.options.time_unit = crate::types::TimeUnit::Microseconds;
        logger.info("We will be testing a fibonnaci function");
        logger.info(format!("Starting fibonnaci({})", x));
        logger.timer_start("wrap");
        logger.timer_start("fibonnaci");
        let y = fibo(x);
        logger.timer_log_and_stop("fibonnaci");
        logger.timer_log_and_stop("wrap");
        logger.info(format!(
            "The result of the fibonnaci function until {} is : {}",
            x, y
        ));
    }

    fn fibo(n: usize) -> usize {
        if n < 3 {
            1
        } else {
            fibo_alt(1, 1, n)
        }
    }

    fn fibo_alt(a: usize, b: usize, n: usize) -> usize {
        if n == 2 {
            b
        } else {
            fibo_alt(b, a + b, n - 1)
        }
    }
}

mod timer;

pub mod logger;
pub mod modules;
pub mod options;
pub mod types;

pub use crate::logger::Logger;
pub use crate::modules::Module;
pub use crate::options::Options;