Expand description
Best-effort telemetry firehose logging with bounded topic state.
The crate keeps the hot path intentionally small: a logger filters topics, assigns per-topic sequence counters, formats either text or NDJSON lines, and forwards them to a sink.
By default, no topics are enabled. Configure LoggerConfig::filter to
enable emission.
use ratatouille::{Format, Logger, LoggerConfig, SourceIdentity};
let mut config = LoggerConfig::default();
config.filter = Some("api*,-api:noise".into());
config.format = Format::Ndjson;
config.source = SourceIdentity {
app: Some("example".into()),
r#where: Some("rust".into()),
instance: Some("local".into()),
};
let mut logger = Logger::new(config);
assert_eq!(logger.log("api", "hello"), ratatouille::EmitResult::Emitted);
assert_eq!(logger.log("api:noise", "drop me"), ratatouille::EmitResult::Filtered);Structs§
- FnSink
- Sink adapter for an arbitrary callback.
- Http
Relay - Bounded in-memory HTTP relay with explicit flushing.
- Http
Relay Config - Configuration for the bounded HTTP relay.
- Http
Relay Stats - Counters for the bounded HTTP relay.
- Http
Sink - Plain HTTP sink that posts NDJSON chunks to a single endpoint.
- Http
Sink Config - Configuration for the plain HTTP sink.
- Http
Sink Stats - Counters for the plain HTTP sink.
- Logger
- Topic logger with per-topic sequence counters.
- Logger
Config - Logger configuration.
- Source
Identity - Optional source identity included in NDJSON output.
- Stats
- Per-logger counters.
- Stdout
Sink - Sink that writes each line to stdout.
- TcpRelay
- Bounded in-memory TCP relay with explicit flushing.
- TcpRelay
Config - Configuration for the bounded TCP relay.
- TcpRelay
Stats - Counters for the bounded TCP relay.
- TcpSink
- Plain TCP sink that sends newline-terminated chunks to one endpoint.
- TcpSink
Config - Configuration for the plain TCP sink.
- TcpSink
Stats - Counters for the plain TCP sink.
Enums§
- Drop
Policy - Queue overflow behavior for relay sinks.
- Emit
Result - Outcome of one log attempt.
- Format
- Output line format for emitted records.
Traits§
- Sink
- Sink interface for receiving already-formatted lines.