Skip to main content

hyperlane_plugin_logger/
lib.rs

1//! hyperlane-plugin-logger
2//!
3//! A high-concurrency logging plugin for the Hyperlane framework with
4//! non-blocking buffered file output, pluggable sinks, plain/JSON formats,
5//! and CRLF/ANSI log-forging sanitization.
6
7mod r#const;
8mod r#enum;
9mod r#fn;
10mod r#impl;
11mod r#static;
12mod r#struct;
13mod r#trait;
14mod r#type;
15
16#[cfg(test)]
17#[path = "../tests/mod.rs"]
18mod tests;
19
20pub use {r#const::*, r#enum::*, r#struct::*, r#trait::*, r#type::*};
21
22pub use log::LevelFilter;
23
24pub(crate) use {r#fn::*, r#static::*};
25
26use std::{
27    fmt::{self, Debug, Formatter},
28    fs::{File, OpenOptions},
29    io::{self, BufWriter, Write, stdout},
30    sync::{
31        Arc, OnceLock,
32        atomic::{AtomicU64, Ordering},
33        mpsc::{Receiver, RecvError, SyncSender, TrySendError, sync_channel},
34    },
35    thread::{Builder, JoinHandle},
36    time::Instant,
37};
38
39use {
40    hyperlane::{Context, RequestMethod, ServerHook, Status, Stream},
41    log::{Level, Metadata, Record, SetLoggerError, log_enabled, set_logger, set_max_level},
42};