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
- Host: GitHub
- URL: https://github.com/mrnossiom/label-logger
- Owner: mrnossiom
- License: cecill-2.1
- Created: 2022-02-27T21:42:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T21:15:43.000Z (about 1 year ago)
- Last Synced: 2025-10-04T16:50:54.636Z (9 months ago)
- Topics: cargo, logging, prompt
- Language: Rust
- Homepage:
- Size: 141 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Cargo-like logging library
# 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.