fn read_from_journal(test_name: &str) -> Vec<HashMap<String, Field>> {
    let stdout = String::from_utf8(
        Command::new("journalctl")
            // We pass --all to circumvent journalctl's default limit of 4096 bytes for field values
            .args(&["--user", "--output=json", "--all"])
            // Filter by the PID of the current test process
            .arg(format!("_PID={}", std::process::id()))
            .arg(format!("TEST_NAME={}", test_name))
            .output()
            .unwrap()
            .stdout,
    )
    .unwrap();

    stdout
        .lines()
        .map(|l| serde_json::from_str(l).unwrap())
        .collect()
}
/// Read from journal with `journalctl`.
///
/// `test_name` is a string to match in the `TEST_NAME` field
/// of the `journalctl` call, to make sure to only select journal entries
/// originating from and relevant to the current test.
///
/// Additionally filter by the `_PID` field with the PID of this
/// test process, to make sure this method only reads journal entries
/// created by this test process.
Read from journal with `journalctl`.

Additionally filter by the `_PID` field with the PID of this
test process, to make sure this method only reads journal entries
created by this test process.
Read from journal with ` journalctl ` . Additionally filter by the ` _PID ` field with the PID of this test process to make sure this method only reads journal entries created by this test process .
fn read_from_journal(test_name: &str) -> Vec<HashMap<String, Field>> {
    let stdout = String::from_utf8(
        Command::new("journalctl")
            // We pass --all to circumvent journalctl's default limit of 4096 bytes for field values
            .args(&["--user", "--output=json", "--all"])
            // Filter by the PID of the current test process
            .arg(format!("_PID={}", std::process::id()))
            .arg(format!("TEST_NAME={}", test_name))
            .output()
            .unwrap()
            .stdout,
    )
    .unwrap();
    stdout
        .lines()
        .map(|l| serde_json::from_str(l).unwrap())
        .collect()
}
fn read_from_journal ( test_name : & str ) -> Vec < HashMap < String , Field > > { let stdout = String :: from_utf8 ( Command :: new ( " " ) // We pass --all to circumvent journalctl's default limit of 4096 bytes for field values . args ( & [ " " , " " , " " ] ) // Filter by the PID of the current test process . arg ( format ! ( " " std process id ( ) ) ) . arg ( format ! ( " " test_name ) ) . output ( ) . unwrap ( ) . stdout , ) . unwrap ( ) ; stdout . lines ( ) . map ( | l | serde_json :: from_str ( l ) . unwrap ( ) ) . collect ( ) }
Read from journal with `journalctl`.
Read from journal with ` journalctl ` .
test_name
&str