An open API service indexing awesome lists of open source software.

https://github.com/mrnossiom/label-logger

A Cargo-like logging library
https://github.com/mrnossiom/label-logger

cargo logging prompt

Last synced: 8 months ago
JSON representation

A Cargo-like logging library

Awesome Lists containing this project

README

          


label-logger logo


Cargo-like logging library


Nix Powered

Time spent


Crates.io Version

# Usage

```rust
use label_logger::{info, log, success};

info!(label: "Compiling", "the program");
log!("information without label");
log!("more informations without label");
success!(label: "Finished", "the compilation");
```

The library also includes themes for [`dialoguer`](https://github.com/mitsuhiko/dialoguer/) (a library to prompt the user in the terminal) and [`indicatif`](https://github.com/console-rs/indicatif) (to show nice progress bars).

See [**examples**](https://github.com/mrnossiom/label-logger/tree/main/examples) for more use-case.

This library is still under `v1`, if necessary, breaking API changes can happen.

# Credits

- **[woobuc/sweep](https://github.com/woobuc/sweep)** for the logging theme idea.
- **[rust-lang/log](https://github.com/rust-lang/log)** for macros inspiration.

---

This work is licensed under [`CeCILL-2.1`](https://choosealicense.com/licenses/cecill-2.1), a strong copyleft French OSS license. This license allows modification and distribution of the software while requiring the same license for derived works.