Skip to main content

appcore_log/
lib.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: lib.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: unknown by dnettoRaw
7//    ##   ## ##   ##    U: working-tree by dnettoRaw
8//      ###########      S: 1.0.2-rc
9// =============================================================================
10
11//! Safe structured operational logging for `AppCore`.
12//!
13//! Events are filtered before formatting, sanitized before every ordinary sink,
14//! and retained only under explicit count and byte limits. Severity describes
15//! impact; [`Verbosity`] describes detail and is independent of sensitivity.
16//! `Sensitive` policy output is accepted only by [`SensitiveDntSink`], which
17//! writes an authenticated encrypted `DNT` envelope and never falls back to text.
18
19#![deny(missing_docs)]
20
21mod async_sink;
22mod clock;
23mod config;
24mod dispatcher;
25mod event;
26mod json_line;
27mod policy;
28mod sink;
29mod sizes;
30
31pub use async_sink::{
32    AsyncSink, AsyncSinkConfig, AsyncSinkStats, MAX_ASYNC_LOG_BYTES, MAX_ASYNC_LOG_EVENTS,
33};
34pub use clock::{FixedLogClock, LogClock, SystemLogClock};
35pub use config::{ConfiguredLogger, LogConfigError, LogOutputMode, LoggerConfig};
36pub use dispatcher::{LogBuilder, LogDispatcher, LogStats, SinkStats};
37pub use event::{
38    LogEvent, LogEventError, LogField, Severity, Verbosity, VerbosityError, MAX_LOG_FIELDS,
39    MAX_LOG_FIELD_KEY_BYTES, MAX_LOG_FIELD_VALUE_BYTES, MAX_LOG_TEXT_BYTES,
40};
41pub use policy::{LogPolicy, PathAliases, Sensitivity};
42pub use sink::{
43    ConsoleSink, FileArchiveConfig, FileSink, FileSinkConfig, LogError, LogSink, RingBufferSink,
44    SensitiveDntSink, SensitiveDntSinkConfig,
45};
46pub use sizes::{
47    LOG_SIZE_16_MIB, LOG_SIZE_1_MIB, LOG_SIZE_2_MIB, LOG_SIZE_32_MIB, LOG_SIZE_4_MIB,
48    LOG_SIZE_64_MIB, LOG_SIZE_8_MIB,
49};
50
51#[cfg(test)]
52mod tests;