Expand description
hyperlane-log
A Rust logging library that supports both asynchronous and synchronous logging. It provides multiple log levels, such as error, info, and debug. Users can define custom log handling methods and configure log file paths. The library supports log rotation, automatically creating a new log file when the current file reaches the specified size limit. It allows flexible logging configurations, making it suitable for both high-performance asynchronous applications and traditional synchronous logging scenarios. The asynchronous mode utilizes Tokio’s async channels for efficient log buffering, while the synchronous mode writes logs directly to the file system.
Structs§
- File
Logger - Main configuration structure for log file output.
Constants§
- DEBUG_
DIR - Subdirectory name for debug logs.
- DEFAULT_
LOG_ DIR - Default directory path for storing log files.
- DEFAULT_
LOG_ FILE_ SIZE - Default maximum size limit for log files in bytes.
- DEFAULT_
LOG_ FILE_ START_ IDX - Default starting index number for log files.
- DISABLE_
LOG_ FILE_ SIZE - Special value indicating no size limit for log files.
- ERROR_
DIR - Subdirectory name for error logs.
- INFO_
DIR - Subdirectory name for info logs.
- LOG_
EXTENSION - File extension for log files.
- TRACE_
DIR - Subdirectory name for trace logs.
- WARN_
DIR - Subdirectory name for warn logs.
Traits§
- File
Logger Func Trait - Trait for log formatting functions.
Functions§
- common_
log - Formats log data with timestamp for each line.
- log_
handler - Handles log data formatting by delegating to common_log.