A basic log implementation.
Cargo.toml
.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. E.g.
toml
[dependencies]
basic-logger = { version = "0.1", default-features = false }
E.g. ```rust use basic_logger::BasicLogger;
use log::{error, info, warn};
fn main() { BasicLogger::new().init().unwrap();
error!("This is an example error message.");
info!("This is an example success message.");
warn!("This is an example warning message.");
} ```
You can also set the default log level by calling the with_level
method. E.g.
```rust
use log::LevelFilter;
...
BasicLogger::new().with_level(LevelFilter::Info).init().unwrap(); ```
This project is under the MIT license.