basic-logger 0.1.2

A basic logger for the log facade.
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented1 out of 5 items with examples
  • Size
  • Source code size: 9.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.31 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • embolic

basic-logger

Crate Docs

A basic logger for the log facade.

Usage

1. Add the required dependencies to your Cargo.toml.

[dependencies]

basic-logger = "0.1"

log = "0.4"

Note: Coloured output will be enabled by default. You can remove this feature by disabling all features.

[dependencies]

basic-logger = { version = "0.1", default-features = false }

2. Initialize the logger (Do this as early as possible in your project).

use basic_logger::BasicLogger;

use log::info;

fn main() {
    BasicLogger::new().init().unwrap();

    info!("Hello, world!");
}

You can also set the default log level by calling the with_level method.

use log::LevelFilter;

...

BasicLogger::new().with_level(LevelFilter::Info).init().unwrap();

Showcase


License

This project is under the MIT license.