t_logger
A versatile and stylish logging library for Rust applications that provides both console output and file logging capabilities.
Features
- 📝 Multiple log levels (info, warn, error, success, debug)
- 🎨 Colored output with ANSI escape codes
- 📦 Box-style formatted messages
- 📅 Automatic daily log file rotation
- 🔍 Debug mode toggle
- ⏰ Timestamp integration
- 💾 File logging with clean (ANSI-stripped) output
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
use *;
Log Levels
info!()/info_box!()- Cyan colored information messageswarn!()/warn_box!()- Yellow colored warning messageserror!()/error_box!()- Red colored error messagessuccess!()/success_box!()- Green colored success messagesdebug!()/debug_box!()- Magenta colored debug messages
File Logging
Logs are automatically saved to files with the format YYYY-MM-DD.log in the specified directory. All ANSI color codes are stripped from the file output for better readability.
License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Example Output
ℹ 12:34:56.789 │ Server Starting up...
✔ 12:34:56.790 │ Login User Alice connected
⚠ 12:34:56.791 │ Memory Usage at 85%
✖ 12:34:56.792 │ Database Connection failed