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

A few small fixes in cysystemd.reader #61

Merged
merged 3 commits into from
Dec 4, 2023

Conversation

dairiki
Copy link
Contributor

@dairiki dairiki commented Dec 4, 2023

This PR includes three minor fixes to cysstemd.reader. (Let me know if you'd like me to split it into separate PRs.)

Fix JournalEntry.date

Sets the .tzinfo attribute of the datetime returned by the JournalEntry.date attribute. This fixes #60.

Fix JournalEntry.boot_id

Fixes the JournalEntry.boot_id method (and converts it to a property). It was totally broken — it just returned itself (a method instance).

Fix JournalOpenMode

Fixes JournalOpenMode making it an IntFlag rather than an IntEnum. It should be a flag — that is, it members can be bit-ORed with each other. The IntEnum does not allow that. In particular, I would like to be able to pass flags=0 to JournalReader.open in order to be able to implement the same functionality as passing the --merge option to journalctl

The boot_id method was just returning itself: a reference to a method.

This fixes that, as well as converts it to a property.
In particular, we want to be able to pass `flags=0` to implement the
functionality of the journalctl's `--merge` option.

But the open flags are [clearly meant] to be bitwise or-ed with each
other.

[clearly meant]: https://github.com/systemd/systemd/blob/cc9f4cad8cd759ab55048dc7a3eaa2c2fb0344da/src/systemd/sd-journal.h#L66C1-L77C3
@mosquito mosquito merged commit 2b3ff16 into mosquito:master Dec 4, 2023
@mosquito
Copy link
Owner

mosquito commented Dec 4, 2023

@dairiki released as 1.6.0

@dairiki
Copy link
Contributor Author

dairiki commented Dec 4, 2023

@mosquito Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Journal Reader reports date with incorrect timezone.
2 participants