1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! Parser for FreeSWITCH log files.
//!
//! Handles the full complexity of `mod_logfile` output: five distinct line
//! formats, multi-line CHANNEL_DATA and SDP dumps, truncated buffer collisions,
//! and per-session state tracking — all with zero dependencies and no regex.
//!
//! # Architecture
//!
//! The parser is organized in three composable layers, each wrapping the previous:
//!
//! - **Layer 1** ([`parse_line`]) — stateless, zero-allocation single-line classifier
//! - **Layer 2** ([`LogStream`]) — structural state machine that groups continuations,
//! classifies messages, and detects multi-line blocks
//! - **Layer 3** ([`SessionTracker`]) — per-UUID state machine that propagates
//! dialplan context, channel state, and variables across entries
//!
//! See `docs/design-rationale.md` in the repository for the full story on format
//! discovery, parsing strategy, and why each layer exists.
//!
//! # Examples
//!
//! Read lines from stdin, process through all three layers, and print enriched entries:
//!
//! ```no_run
//! use std::io::{self, BufRead};
//! use freeswitch_log_parser::{LogStream, SessionTracker};
//!
//! let lines = io::stdin().lock().lines().map(|l| l.expect("read error"));
//! let stream = LogStream::new(lines);
//! let mut tracker = SessionTracker::new(stream);
//!
//! for enriched in tracker.by_ref() {
//! let e = &enriched.entry;
//! println!("{} [{}] {}", e.timestamp, e.message_kind, e.message);
//! }
//!
//! let stats = tracker.stats();
//! eprintln!("{} lines, {} unclassified",
//! stats.lines_processed, stats.lines_unclassified);
//! ```
//!
//! # Feature flags
//!
//! - **`cli`** — enables the `fslog` binary with clap, xz decompression, and regex filtering
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;