Skip to content
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

Support realtime cutoff access #92

Merged
merged 2 commits into from Aug 16, 2022

Conversation

chrismullins
Copy link

Output from journalctl is prepended with a string like:

-- Journal begins at Mon 2020-11-23 02:18:37 UTC, ends at Sat 2021-01-02 22:20:10 UTC. --

which is generated using the sd_journal_get_cutoff_realtime_usec call. This PR adds the capability to access these values from inside the python wrapper by exposing get_start() and get_end() methods on the journal object, returning a datetime. Addresses #84.

It's been a while since I've used the Python C API, happy to address feedback if anyone has time.

@lgtm-com
Copy link

lgtm-com bot commented Jan 3, 2021

This pull request introduces 2 alerts when merging d6b3af9 into 2166b57 - view on LGTM.com

new alerts:

  • 2 for Ambiguously signed bit-field member

@keszybz
Copy link
Member

keszybz commented Aug 16, 2022

Thanks, looks nice.

@keszybz keszybz merged commit 6320847 into systemd:main Aug 16, 2022
@keszybz keszybz linked an issue Aug 16, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

How to get the start and end date of journal files in Python?
2 participants