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
//! # zcolorizer
//!
//! A real-time log colorizer — a Rust port of [ccze] and the pygments
//! regex→token idea — with **fully customizable rules** and **swappable themes**.
//!
//! The pipeline is three decoupled pieces:
//!
//! 1. [`rules`] — regexes that tag spans of a line with a semantic *token*
//! (`date`, `error`, `host`, …). Named capture groups make one regex paint
//! several fields. Rules live in the config, so users own them entirely.
//! 2. [`theme`] — a named map from token → [`color::Style`]. The active theme
//! decides what each token looks like; swapping it recolors everything
//! (the "pick the theme from zgui" flow). The flagship is [`theme::cyberpunk`].
//! 3. [`engine::Colorizer`] — runs the compiled rules over each line and paints
//! the claimed spans with the theme.
//!
//! [`config::Config`] ties them together from a TOML file.
//!
//! ## Quick start
//!
//! ```
//! use zcolorizer::Colorizer;
//! let cz = Colorizer::from_config(&zcolorizer::config::Config::default(), None).unwrap();
//! let painted = cz.colorize_line("Jun 27 14:03:11 host sshd[1234]: ERROR bad login");
//! assert!(painted.contains("\x1b["));
//! ```
//!
//! [ccze]: https://github.com/cornet/ccze
pub use ;
pub use Config;
pub use Colorizer;
pub use ;
pub use Theme;