hyperlane-plugin-logger 23.2.0

A logging plugin for the Hyperlane framework, writing the log of a server to the console, to a file, or to both.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::*;

/// The configuration the plugin was given, when it was given one.
pub(super) static CONFIG: OnceLock<LoggerConfig> = OnceLock::new();

/// Non-blocking channel feeding the background buffered file writer thread.
pub(super) static WRITER_TX: OnceLock<Option<SyncSender<WriterCommand>>> = OnceLock::new();

/// Lock-free count of records dropped when the background writer channel was saturated.
pub(super) static DROPPED_RECORDS: AtomicU64 = AtomicU64::new(0);

thread_local! {
    /// Thread-local reusable line formatting buffer eliminating per-record heap allocations.
    pub(crate) static LOG_LINE_BUF: RefCell<String> = RefCell::new(String::with_capacity(256));
}