X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fpython-systemd%2Fdocs%2Fjournal.rst;h=ea74cf85c408f499255e95a091db684e1173930b;hb=7e63dd1015c9ac6fc2042e45b0a87a3f9f8b9336;hp=89728a2ecb54500d9fb812489a947493e99f509e;hpb=c1db45c6a5b0bd2ad7ddbfd877162794ac3a48f8;p=elogind.git diff --git a/src/python-systemd/docs/journal.rst b/src/python-systemd/docs/journal.rst index 89728a2ec..ea74cf85c 100644 --- a/src/python-systemd/docs/journal.rst +++ b/src/python-systemd/docs/journal.rst @@ -13,12 +13,52 @@ Accessing the Journal --------------------- -.. autoclass:: _Journal +.. autoclass:: _Reader :undoc-members: :inherited-members: -.. autoclass:: Journal +.. autoclass:: Reader :undoc-members: :inherited-members: .. automethod:: __init__ + +.. autofunction:: _get_catalog +.. autofunction:: get_catalog + +.. autoclass:: Monotonic + +.. autoattribute:: systemd.journal.DEFAULT_CONVERTERS + +Example: polling for journal events +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This example shows that journal events can be waited for (using +e.g. `poll`). This makes it easy to integrate Reader in an external +event loop: + + >>> import select + >>> from systemd import journal + >>> j = journal.Reader() + >>> j.seek_tail() + >>> p = select.poll() + >>> p.register(j, j.get_events()) + >>> p.poll() + [(3, 1)] + >>> j.get_next() + + +Journal access types +~~~~~~~~~~~~~~~~~~~~ + +.. autoattribute:: systemd.journal.LOCAL_ONLY +.. autoattribute:: systemd.journal.RUNTIME_ONLY +.. autoattribute:: systemd.journal.SYSTEM +.. autoattribute:: systemd.journal.CURRENT_USER + +Journal event types +~~~~~~~~~~~~~~~~~~~ + +.. autoattribute:: systemd.journal.NOP +.. autoattribute:: systemd.journal.APPEND +.. autoattribute:: systemd.journal.INVALIDATE