Skip to content

Commit

Permalink
improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Hassan committed Jan 17, 2024
1 parent b3f6413 commit b25c4bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/journal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use systemd::{journal, Journal};
pub fn open_journal_tail() -> Journal {
let mut j = journal::OpenOptions::default().open().expect("Could not open journal");

j.seek_tail().expect("Failed to seek to tail");
j.seek_tail().expect("[open_journal] Failed to seek to tail");

println!("Seeked to tail, waiting for next entry ...\n");
j.wait(None).expect("Failed to wait for last entry");
j.previous().expect("Failed to position cursor for following tail");
println!("[open_journal] Seeked to tail ...\n");
j.wait(None).expect("[open_journal] Failed to wait for last entry");
j.previous().expect("[open_journal] Failed to position cursor for following tail");
j
}

Expand All @@ -29,7 +29,7 @@ impl LogEntry {
"message" => Ok(self.message.clone()),
"MESSAGE" => Ok(self.message.clone()),
"priority" => Ok(self.priority.to_string()),
_ => Err(format!("Field {} not found", field_string)),
_ => Err(format!("[LogEntry get] Field {} not found", field_string)),
}
}
}

0 comments on commit b25c4bd

Please sign in to comment.