| Crates.io | brk_logger |
| lib.rs | brk_logger |
| version | 0.1.0-beta.0 |
| created_at | 2025-02-23 23:29:09.312366+00 |
| updated_at | 2026-01-25 13:21:09.313964+00 |
| description | A thin wrapper around tracing with size-based log rotation |
| homepage | https://bitcoinresearchkit.org |
| repository | https://github.com/bitcoinresearchkit/brk |
| max_upload_size | |
| id | 1566724 |
| size | 20,928 |
Colorized, timestamped logging with optional file output and hooks.
Drop-in logging initialization that silences noisy dependencies (bitcoin, fjall, rolldown, ...) while keeping your logs readable with color-coded levels and local timestamps.
brk_logger::init(Some(Path::new("app.log")))?; // Console + file
brk_logger::init(None)?; // Console only
brk_logger::register_hook(|msg| {
// React to log messages
})?;
use tracing::info;
fn main() -> std::io::Result<()> {
brk_logger::init(None)?;
info!("Ready");
Ok(())
}