| Crates.io | logger_bro |
| lib.rs | logger_bro |
| version | 0.3.0 |
| created_at | 2025-09-11 03:58:24.902523+00 |
| updated_at | 2025-09-13 08:18:34.272618+00 |
| description | A simple, aligned, colorful logger with [level] [obj]: message formatting. |
| homepage | |
| repository | https://github.com/ |
| max_upload_size | |
| id | 1833307 |
| size | 5,986 |
This Rust program defines a lightweight logging utility with custom formatting:
INFO, WARN, CRIT), each automatically colored (red for level, green for object tag).obj string, centered to a fixed width for clean alignment.[LEVEL] (obj): message
with a consistent gap after the colon.
info!, warn!, and crit! macros provide shorthand for logging messages without manually calling format_args!.stdout by default) in a Mutex, making it safe for concurrent use.This makes it easy to track structured logs in Rust projects with aligned, color-coded, and thread-safe output.
let Logger = Logger::new(obj_txt_width)
pub static LOGGER: Lazy<Logger> = Lazy::new(|| Logger::new(obj_txt_width));
use logger_bro::{info, crit, warn};
use super::{your_file}::LOGGER; // If it is defined elsewhere
info!(
&LOGGER,
"obj",
"msg",
args,
);