Crate hyperlane_log

Source
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§

LogFuncTrait
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.
ArcLogFunc
Thread-safe shared reference to a log formatting function.
ListLog
A collection of named log formatting functions.
LogArcLock
Thread-safe shared reference to a Log configuration instance.
LogFunc
Trait object representing a log formatting function.
LogListArcLock
Thread-safe shared reference to a collection of log functions.