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
// SPDX-License-Identifier: LGPL-2.1-or-later
//! # qjournal
//!
//! Cross-platform native implementation of the systemd-journald binary journal format.
//!
//! This library can read and write `.journal` files that are fully compatible with
//! `journalctl --file=<path>`, without depending on `libsystemd`.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use qjournal::JournalWriter;
//! use std::path::Path;
//!
//! let mut writer = JournalWriter::open(Path::new("/tmp/test.journal")).unwrap();
//! writer.append_entry(&[
//! ("MESSAGE", b"Hello, world!" as &[u8]),
//! ("PRIORITY", b"6"),
//! ("SYSLOG_IDENTIFIER", b"myapp"),
//! ]).unwrap();
//! writer.flush().unwrap();
//! ```
//!
//! ## Reading
//!
//! ```rust,no_run
//! use qjournal::JournalReader;
//! use std::path::Path;
//!
//! let mut reader = JournalReader::open(Path::new("/tmp/test.journal")).unwrap();
//! for entry in reader.entries().unwrap() {
//! if let Some(msg) = entry.get(b"MESSAGE") {
//! println!("{}", String::from_utf8_lossy(msg));
//! }
//! }
//! ```
pub use ;
pub use JournalReader;
pub use ;
pub use ;