Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrivers/rust-colog
A simple color-coded logging implementation for the standard rust logging system
https://github.com/chrivers/rust-colog
Last synced: 17 days ago
JSON representation
A simple color-coded logging implementation for the standard rust logging system
- Host: GitHub
- URL: https://github.com/chrivers/rust-colog
- Owner: chrivers
- License: lgpl-3.0
- Created: 2016-10-13T22:10:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-23T09:35:39.000Z (8 months ago)
- Last Synced: 2024-04-24T18:23:46.106Z (7 months ago)
- Language: Rust
- Size: 51.8 KB
- Stars: 30
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple colored logger for rust #
The `colog` library is a simple formatter backend for the standard
rust logging system (in the `log` crate).## Getting started ##
```rust
use log::{error, warn, info, debug, trace};fn main() {
// Quick start: use default initialization
colog::init();error!("error message");
error!("error with fmt: {}", 42);
warn!("warn message");
info!("info message");
debug!("debug message");
trace!("trace message");info!("multi line demonstration\nhere");
info!("more\nmulti\nline\nhere\nhere");
}
```This results in the following terminal output:
![demo screenshot from terminal](https://raw.githubusercontent.com/chrivers/rust-colog/master/screenshot.png)
## Custom styling ##
It's possible to override all colors and styles of `colog`.
See the following examples:
- [examples/custom-level-colors.rs](examples/custom-level-colors.rs)
- [examples/custom-level-tokens.rs](examples/custom-level-tokens.rs)
- [examples/custom-level-prefix.rs](examples/custom-level-prefix.rs)Also be sure to read the documentation (`cargo doc --open`) for a detailed description.
## Known issues and improvements ##
There are no known, serious, unsolved issues.
Patches welcome :)
## License ##
This project is licensed under the LGPLv3. See the file `LICENSE` for
details.