lawg 0.1.0

lawg is a Rust library designed to log and create log files with ease.
Documentation
  • Coverage
  • 78.57%
    11 out of 14 items documented8 out of 11 items with examples
  • Size
  • Source code size: 11.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 343.99 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • vs-123/lawg
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vs-123

lawg

lawg is a Rust library designed to log and create log files with ease.

Example

use lawg::Logger;

fn main() {
    let logger = Logger::new(String::from("General Logger"), Some(String::from("logs.txt")), true);

    logger.log("Started"); // My Logger - ["yyyy-mm-dd hh:mm:ss UTC"]: Started
    logger.log_to_file("Started again");

    let mut x = 1 + 1;

    if x == 2 {
        logger.log_and_log_to_file(String::from("It is two")); // My Logger - ["yyyy-mm-dd hh:mm:ss UTC"]: It is two
    } else {
        logger.error_and_stop("1 + 1 is not two"); // ERROR: My Logger - ["yyyy-mm-dd hh:mm:ss UTC"]: 1 + 1 is not two
    }
}