Expand description
§Pretint - Pretty Print Library for Rust
A comprehensive logging library inspired by Pino but designed for Rust with multiple APIs and easier usage. Features structured logging, multiple output formats, and performance timing.
§Quick Start
use pretint::{Pretint, Level};
let logger = Pretint::new();
logger.info("Hello, world!");
logger.info_with_fields("User logged in", &[("user_id", "123"), ("ip", "192.168.1.1")]);§Features
- Multiple output formats (JSON, Pretty, Compact)
- Structured logging with fields
- Child loggers for context propagation
- Performance timing utilities
- Convenient macros for easy usage
- Colored output support
- Multiple log levels (trace, debug, info, warn, error)
Re-exports§
pub use logger::Pretint;pub use logger::Config;pub use level::Level;pub use format::OutputFormat;pub use errors::PretintError;
Modules§
Macros§
- child_
logger - Create a child logger with fields
- debug
- Log a debug message
- debug_
fields - Log a debug message with fields
- error
- Log an error message
- error_
fields - Log an error message with fields
- info
- Log an info message
- info_
fields - Log an info message with fields
- logger_
with_ config - Create a logger with configuration
- logger_
with_ format - Create a logger with a specific format
- logger_
with_ level - Create a logger with a specific level
- timer
- Create a timer guard for automatic timing
- timer_
labeled - Create a timer guard with a label
- trace
- Convenient macros for Pretint logging
- trace_
fields - Log a trace message with fields
- warn
- Log a warning message
- warn_
fields - Log a warning message with fields