/// hydrant configuration pub mod config; /// hydrant main api, includes the Hydrant type for programmatic control. pub mod control; pub(crate) mod filter; pub(crate) mod pds_daily_limit; pub(crate) mod pds_meta; pub mod types; /// dependencies hydrant uses in it's public api pub mod deps { #[cfg(feature = "user-keyspace")] pub use fjall; pub use futures; pub use jacquard_common as jacquard; pub use rustls; pub use smol_str; } #[cfg(all( feature = "relay", any(feature = "indexer", feature = "indexer_stream", feature = "backlinks") ))] compile_error!("can't be relay and indexer at the same time"); #[cfg(all( not(feature = "indexer"), any(feature = "indexer_stream", feature = "backlinks") ))] compile_error!("indexer dependent features (stream, backlinks) without indexer can't be enabled"); #[cfg(all( feature = "jetstream", not(any(feature = "indexer_stream", feature = "relay")) ))] compile_error!("jetstream requires either indexer_stream or relay"); pub(crate) mod api; #[cfg(feature = "indexer")] pub(crate) mod backfill; #[cfg(feature = "backlinks")] pub mod backlinks; pub(crate) mod car; #[cfg(feature = "indexer")] pub(crate) mod crawler; pub(crate) mod db; pub(crate) mod ingest; #[cfg(feature = "jetstream")] pub(crate) mod jetstream; pub(crate) mod mst; pub(crate) mod net; #[cfg(feature = "indexer")] pub(crate) mod ops; pub(crate) mod patch; pub(crate) mod pds_discovery; pub mod resolver; #[cfg(feature = "indexer")] pub(crate) mod sparse_mst; pub(crate) mod state; pub(crate) mod util; pub use filter::FilterMode; /// the log filter when `RUST_LOG` is unset. fjall and lsm-tree log every keyspace they /// recover at info, dozens of lines per start, and hydrant's own open and ready lines /// already bracket that. pub const DEFAULT_LOG_FILTER: &str = "info,fjall=warn,lsm_tree=warn"; #[cfg(test)] mod tests { #[test] fn default_log_filter_quiets_db_recovery_but_keeps_its_warnings() { let logs = crate::util::capture_logs(super::DEFAULT_LOG_FILTER, || { // fjall and lsm-tree log through `log`, and tracing-log keeps their module as the target tracing::info!(target: "lsm_tree::tree", "Recovering LSM-tree at /db/keyspaces/1"); tracing::info!(target: "fjall::db", "Recovering database at /db"); tracing::warn!(target: "lsm_tree::compaction::worker", "compaction failed"); tracing::info!(target: "hydrant::db::open", "database ready"); }); assert!(!logs.contains("Recovering"), "{logs}"); assert!(logs.contains("compaction failed"), "{logs}"); assert!(logs.contains("database ready"), "{logs}"); } }