Skip to main content

Crate logdive_core

Crate logdive_core 

Source
Expand description

§logdive-core

Core library for logdive — structured log parsing, SQLite-backed indexing, and a hand-written query engine.

This crate is pure library code with no I/O side effects at the module level. It is consumed by the logdive CLI binary and the logdive-api HTTP server binary.

v0.2.0 introduced multi-format ingestion: JSON, logfmt, and plain text. See parsers for the format-specific parsers and the format-aware parse_line dispatcher.

v0.2.0 also introduces follow (Unix-only), which provides FileTailer for tracking a growing file and detecting log rotation and truncation. Used by the CLI’s --follow flag.

Re-exports§

pub use entry::LogEntry;
pub use error::LogdiveError;
pub use error::Result;
pub use executor::execute;
pub use executor::execute_at;
pub use indexer::BATCH_SIZE;
pub use indexer::Indexer;
pub use indexer::InsertStats;
pub use indexer::Stats;
pub use indexer::db_path;
pub use parsers::LogFormat;
pub use parsers::parse_line;
pub use query::AndGroup;
pub use query::Clause;
pub use query::CompareOp;
pub use query::Duration;
pub use query::DurationUnit;
pub use query::QueryNode;
pub use query::QueryParseError;
pub use query::QueryValue;
pub use query::parse as parse_query;
pub use follow::FileTailer;

Modules§

entry
The LogEntry type — a single parsed log line.
error
Unified error type for logdive-core.
executor
Query executor: translate a QueryNode into parameterized SQL, run it against the index, and reconstruct LogEntry values from the result rows.
follow
File tailing for follow mode (--follow).
indexer
SQLite-backed index for ingested log entries.
parsers
Format-aware line parsing for log ingestion.
query
Query language: tokenizer, AST, and recursive descent parser.