Skip to main content

Crate appcore_log

Crate appcore_log 

Source
Expand description

Safe structured operational logging for AppCore.

Events are filtered before formatting, sanitized before every ordinary sink, and retained only under explicit count and byte limits. Severity describes impact; Verbosity describes detail and is independent of sensitivity. Sensitive policy output is accepted only by SensitiveDntSink, which writes an authenticated encrypted DNT envelope and never falls back to text.

Structs§

AsyncSink
Opt-in non-blocking wrapper around one sink.
AsyncSinkConfig
Count and retained-byte ceilings for one asynchronous sink.
AsyncSinkStats
Lock-free observation of one asynchronous sink.
ConfiguredLogger
Logger assembled from LoggerConfig, including optional crash retention.
ConsoleSink
Human-oriented stdout sink, with no terminal-color assumptions.
FileArchiveConfig
Bounded archive configuration for rotated JSONL files.
FileSink
Synchronous bounded JSONL sink; callers choose it only outside hot paths.
FileSinkConfig
Bounded structured JSONL file configuration.
FixedLogClock
Deterministic clock for tests and reproducible examples.
LogBuilder
Fluent, component-scoped log emitter with an immutable per-event override.
LogDispatcher
Thread-safe fan-out dispatcher; ordinary sinks receive only sanitized events.
LogEvent
Structured operational event passed through the sanitizer before normal sinks.
LogField
One structured field; paths must be supplied as fields instead of embedded text.
LogPolicy
Filters events before formatting and sanitizes values before ordinary sinks.
LogStats
Observable dispatcher counters; sink failures never recursively log.
LoggerConfig
Complete explicit logger configuration.
PathAliases
Explicit local path aliases used by typed path fields.
RingBufferSink
In-memory bounded diagnostic sink.
SensitiveDntSink
Encrypted DNT sink. It has no plaintext fallback and must be explicitly wired.
SensitiveDntSinkConfig
Explicit encrypted sensitive-output configuration.
SinkStats
Failure counter for one configured sink label.
SystemLogClock
Production wall-clock implementation with a controlled pre-epoch fallback.
Verbosity
Detail threshold from V1 (critical) through V9 (deep diagnostics).
VerbosityError
Invalid public verbosity outside the V1–V9 contract.

Enums§

LogConfigError
Invalid high-level logger configuration.
LogError
Logging sink error with no sensitive source text.
LogEventError
Event rejected before sanitization or sink delivery.
LogOutputMode
Explicit destinations for ordinary operational logs.
Sensitivity
Explicit information-handling policy, never inferred from verbosity.
Severity
Operational impact of an event.

Constants§

LOG_SIZE_1_MIB
One mebibyte, suitable for small local or short-lived logs.
LOG_SIZE_2_MIB
Two mebibytes, suitable for small application crash logs.
LOG_SIZE_4_MIB
Four mebibytes, suitable for modest local application logs.
LOG_SIZE_8_MIB
Eight mebibytes, suitable for normal rotating application logs.
LOG_SIZE_16_MIB
Sixteen mebibytes, suitable for moderate operational logs.
LOG_SIZE_32_MIB
Thirty-two mebibytes, suitable for busier bounded services.
LOG_SIZE_64_MIB
Sixty-four mebibytes, suitable for high-volume bounded services.
MAX_ASYNC_LOG_BYTES
Maximum estimated retained bytes accepted by one asynchronous sink.
MAX_ASYNC_LOG_EVENTS
Maximum events accepted by one asynchronous sink configuration.
MAX_LOG_FIELDS
Maximum structured fields attached to one event.
MAX_LOG_FIELD_KEY_BYTES
Maximum UTF-8 bytes retained in one structured field key.
MAX_LOG_FIELD_VALUE_BYTES
Maximum UTF-8 bytes retained in one structured field value.
MAX_LOG_TEXT_BYTES
Maximum UTF-8 bytes retained in one message or identity-like field.

Traits§

LogClock
Supplies Unix timestamps in milliseconds at an application boundary.
LogSink
A destination receiving a sanitized event from crate::LogDispatcher.