X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fpython-systemd%2Fdocs%2Fjournal.rst;h=9dc495ffdb685ff5b331f822598b82e2a6183366;hp=036250a7643d5b860605eea7702c86a287c53158;hb=f2e82cd5add31d704b39a91d570ab6649653fa49;hpb=9015fa646e04fc3cb180bea24c33d34edbb48ed7 diff --git a/src/python-systemd/docs/journal.rst b/src/python-systemd/docs/journal.rst index 036250a76..9dc495ffd 100644 --- a/src/python-systemd/docs/journal.rst +++ b/src/python-systemd/docs/journal.rst @@ -9,3 +9,52 @@ ---------------------- .. autoclass:: JournalHandler + +Accessing the Journal +--------------------- + +.. autoclass:: _Reader + :undoc-members: + :inherited-members: + +.. autoclass:: Reader + :undoc-members: + :inherited-members: + + .. automethod:: __init__ + +.. 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, select.POLLIN) + >>> p.poll() + [(3, 1)] + >>> j.get_next() + + +Journal access types +~~~~~~~~~~~~~~~~~~~~ + +.. autoattribute:: systemd.journal.LOCAL_ONLY +.. autoattribute:: systemd.journal.RUNTIME_ONLY +.. autoattribute:: systemd.journal.SYSTEM_ONLY + +Journal event types +~~~~~~~~~~~~~~~~~~~ + +.. autoattribute:: systemd.journal.NOP +.. autoattribute:: systemd.journal.APPEND +.. autoattribute:: systemd.journal.INVALIDATE