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§
- Log
- 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.
Traits§
- LogFunc
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.
Type Aliases§
- ArcLog
- Thread-safe shared reference to a Log configuration.
- ArcLog
Func - Thread-safe shared reference to a log formatting function.
- ListLog
- A collection of named log formatting functions.
- LogArc
Lock - Thread-safe shared reference to a Log configuration instance.
- LogFunc
- Trait object representing a log formatting function.
- LogList
ArcLock - Thread-safe shared reference to a collection of log functions.