log4rc
A log4j-like logging framework for Rust.
Overview
log4rc is a simple, extensible logging framework inspired by log4j. It provides different log levels and an easy-to-use API for Rust applications.
Features
- Multiple log levels (Trace, Debug, Info, Warn, Error)
- Simple API similar to log4j
- Thread-safe logging
- Timestamped log entries
- Configurable log levels
Installation
Add this to your Cargo.toml:
[]
= "0.1"
Example
use ;
Custom appenders
log4rc is extensible: implement the Appender trait (output target) and the Layout trait (message formatting), then build a logger with Logger::builder.
use ;
;
You can add multiple appenders, and Logger::init remains a shortcut that installs a console appender with the default layout.
License
This project is licensed under the MIT License - see the LICENSE file for details.