| Crates.io | verbosio |
| lib.rs | verbosio |
| version | 0.3.0 |
| created_at | 2025-07-17 23:31:17.312729+00 |
| updated_at | 2025-07-20 16:13:22.861061+00 |
| description | Minimal macro based logging with verbosity levels and optional colors |
| homepage | https://github.com/konni332/verbosio |
| repository | https://github.com/konni332/verbosio |
| max_upload_size | |
| id | 1758328 |
| size | 46,409 |
A minimal, macro-based logging utility for CLI tools and developer scripts.
Supports verbosity levels, optional colored output, and has zero dependencies by default.
u8) via AtomicU8vinfo!, vwarn!, verror!, verbose!, and vebug!color featurestatus_line!) via the status featurevebug! in release buildsset_verbosity!() or environment variable (VERBOSE)Add verbosio to your Cargo.toml:
[dependencies]
verbosio = "0.2"
Optional: enable colored output
verbosio = { version = "0.2", features = ["color", "status", "time"] }
Then in your code:
use verbose_log::*;
fn main() {
set_verbosity!(2);
vinfo!("App started");
vwarn!(@lvl 3, "This will only show if verbosity >= 3");
verror!("Something went wrong");
}
| Macro | Description |
|---|---|
set_verbosity!(lvl?) |
Set global verbosity (u8). Defaults to 1 |
get_verbosity!() |
Get current verbosity level |
verbose_env!() |
Set verbosity from VERBOSE env var |
verbose!(@lvl?, ...) |
Print raw message if verbosity ≥ level |
vinfo!(@lvl?, ...) |
Print [INFO] message if verbosity ≥ level |
vwarn!(@lvl?, ...) |
Print [WARN] message if verbosity ≥ level |
verror!(@lvl?, ...) |
Print [ERROR] message to stderr if verbosity ≥ level |
vebug!(@lvl?, ...) |
Debug-only output — compiled out completely in release builds |
status_line!(@lvl?, msg) |
Start live spinner with message if verbosity ≥ level (status feature) |
status_line_done!(msg) |
Stop spinner and print final message (status feature) |
status_line_clear!() |
Clear the current spinner line (status feature) |
All lvl? are optional. If no level is given, it will be treated like a boolean value!
This means, verbose!("foo") will print if the verbosity is >= 1
All lvl have to be explicit using @lvl: verbose!(@lvl 2, "foo")
You can find runnable examples in the examples directory.
| Feature | Description | Default |
|---|---|---|
color |
ANSI-colored log levels | No |
status |
Animated spinner via status_line! |
No |
time |
Timestamps for verbose!, vinfo!,... | No |
Licensed under either of:
Your choice