loglet
A minimal, zero-heap Rust logging library for CLI applications.
Installation
Add to your Cargo.toml:
[]
= "0.0.1"
Or via the command line:
Features
- Zero heap allocations (uses
fmt::Argumentsthroughout) - Coloured output via
owo-colors - Tagged log entries
- Custom log levels
- Debug logs compiled away in release builds
- Writes errors to
stderr, everything else tostdout
Usage
From examples/basic_usage.rs:
use ;
Check out the examples/ folder for more.
Default Log Levels
| Macro | Prefix | Stream | Color |
|---|---|---|---|
info! |
I |
stdout | Green |
warn! |
W |
stdout | Yellow |
error! |
E |
stderr | Red |
debug! |
D |
stdout | Cyan |
Custom levels are also supported (see examples/custom_level.rs)
Examples
Clone the repo first:
Then run any example:
License
MIT