#![doc(html_root_url = "https://docs.rs/inklog/0.2.0")]
#![cfg_attr(test, allow(clippy::field_reassign_with_default))]
mod error;
mod log_level;
mod validation;
pub mod i18n;
static _LOCALE_INIT: std::sync::LazyLock<()> = std::sync::LazyLock::new(|| {
i18n::init_locale();
});
#[cfg(all(
feature = "kit",
not(any(
feature = "sqlite",
feature = "postgres",
feature = "mysql",
feature = "duckdb"
))
))]
compile_error!(
"The 'kit' feature requires at least one database driver feature: \
\"sqlite\", \"postgres\", or \"mysql\". Enable one or more of these \
features alongside 'kit'."
);
pub use domain::config;
pub use domain::types::log_record;
pub use support::io::sink;
pub use support::processing::template;
pub mod domain;
pub mod support;
#[cfg(feature = "compression")]
pub use support::io::sink::ZstdCompression;
#[cfg(feature = "compression")]
pub use support::io::sink::compression::{compress_data, compress_file, compress_string};
pub use support::io::sink::encryption::{derive_key_from_password, get_encryption_key};
pub use support::io::sink::ring_buffered_file::{
BackpressureStrategy, ChannelBufferedConfig, ChannelBufferedFileSink, ChannelBufferedMetrics,
};
pub use support::io::sink::{
CircuitBreaker, CircuitBreakerConfig, CircuitState, CompositeRotation, CompressionStrategy,
DiskCheckable, FileSinkFactory, GzipCompression, LogSink, NoCompression, Rotatable,
RotationContext, RotationResult, RotationStrategy, SinkFactory, SinkMetadata, SinkRegistry,
SizeBasedRotation, TimeBasedRotation,
};
pub use support::processing::masking;
pub mod integrations;
pub use domain::config::{
ArchiveFormat, ChannelStrategy, ConsoleSinkConfig, DatabaseDriver, DatabaseSinkConfig,
FileSinkConfig, GlobalConfig, HttpAuthConfig, HttpErrorMode, HttpServerConfig, InklogConfig,
ParquetConfig, PartitionStrategy, PerformanceConfig, TlsConfig,
};
pub use domain::types::log_record::LogRecord;
pub use error::InklogError;
pub use error::InklogResult;
#[cfg(any(
feature = "sqlite",
feature = "postgres",
feature = "mysql",
feature = "duckdb"
))]
pub use integrations::DbNexusAdapter;
#[cfg(all(
feature = "kit",
any(
feature = "sqlite",
feature = "postgres",
feature = "mysql",
feature = "duckdb"
)
))]
pub use integrations::InklogModule;
pub use integrations::{
Cache, Config, Database, InklogConfigAdapter, OxCacheAdapter, OxCacheAdapterBuilder,
};
#[cfg(any(test, feature = "test-utils"))]
pub use integrations::{MockCache, MockConfig, MockDatabaseAdapter};
#[cfg(all(
feature = "kit",
any(
feature = "sqlite",
feature = "postgres",
feature = "mysql",
feature = "duckdb"
)
))]
pub use integrations::{InklogBuildObserver, create_inklog_scope, populate_inklog_scope};
pub use domain::core::{
InklogContainer, InklogContainerBuilder, LoggerBuilder, LoggerDependencies, LoggerManager,
};
pub use log_level::{LogLevel, LogLevelParseError};
pub use support::io::{LogAdapter, LogLogger};
pub use support::observability::{
FallbackAction, FallbackConfig, FallbackState, GaugeF64, HealthStatus, Metrics, SinkHealth,
SinkHealthMonitor, SinkStatus,
};
pub use support::processing::{
DataMasker, DataMaskerBuilder, LogTemplate, MaskRule, MaskRuleBuilder, MaskRuleRegistry,
ObjectPool, ObjectPoolConfig, OutputFormat, RateLimiter, get_log_record, get_string_buffer,
put_log_record, put_string_buffer,
};
pub use validation::{
EscapeMode, LogSanitizer, PathValidator, PathValidatorConfig, SanitizerConfig, ValidationResult,
};
pub use chrono;
pub use serde;
pub use tokio;
pub use tracing;