# logs
[](https://crates.io/crates/logs)
[](https://docs.rs/logs)

> A simple terminal logger
## Usage
Add this in your `Cargo.toml`:
```toml
[dependencies]
logs = "*"
```
## Example
```rust
use logs::{debug, error, info, trace, warn, Level, Logs};
fn main() {
Logs::new().init();
trace!("This is a trace log");
debug!("This is a debug log");
info!("This is a info log");
warn!("This is a warn log");
error!("This is a error log");
}
```
Output:
```
2022-09-06T08:38:23.490 [TRACE] This is a trace log
2022-09-06T08:38:23.490 [DEBUG] This is a debug log
2022-09-06T08:38:23.490 [INFO ] This is a info log
2022-09-06T08:38:23.490 [WARN ] This is a warn log
2022-09-06T08:38:23.490 [ERROR] This is a error log
```
## Options
```rust
use logs::{Logs, debug, error};
fn main() {
Logs::new()
// Show log level color
.color(true)
// Filter log level
.level(Level::Info)
// Filter log target
.target("target")
// Filter log target from `LOG` environment variable
.target_from_default_env()
.unwrap()
// Read `NAME` environment variable
.target_from_env("NAME")
.unwrap()
// Apply
.init();
}
```