-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for reading from the system journal #40
base: master
Are you sure you want to change the base?
Conversation
@lucab could you let me know if this looks like it’s on the right track to you? |
@lucab just checking back in to see if you have a moment to give any feedback 😊 |
} | ||
|
||
impl SdJournal { | ||
pub fn open_journal<P: AsRef<Path>>(path: P) -> Result<Self> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a bit of API mismatch here. To the best of my knowledge, the C API never works on a single file in isolation. I think the closest to this is sd_journal_open_files
, which would take a slice of paths instead.
Perhaps we should start with an implementation of sd_journal_open_files_fd
instead, and build the other ones of top of that?
|
||
#[test] | ||
fn test_sdjournal_iter_simple() { | ||
let sd = SdJournal::open_journal("./tests/user-1000.journal").unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this file a bit smaller, just containing a few entry objects?
@jabedude I went through you repo, lots of good stuff! But also a lot of things to read on my side :) How do you want to proceed on this? Can we slowly move code over here? I'm happy to review if it can be split in a few human-sized chunks. |
@lucab thanks for the feedback! As for how to proceed: I'm not sure to be honest. I went back and forth whether my repo should be merged into libsystemd-rs or if it should be standalone. I do think that it makes sense to move things over here. One reason for keeping it standalone would be how to make the core code available if someone wanted to say, re-implement systemd-journald in pure rust if that makes sense. Thoughts? |
Maybe guard with a "feature"? :) |
Closes #39.
This is a draft PR for adding support for reading from systemd's journal in pure rust.