chiark / gitweb /
html: make python docs look more like the rest
[elogind.git] / src / python-systemd / docs / journal.rst
1 `systemd.journal` module
2 ========================
3
4 .. automodule:: systemd.journal
5    :members: send, sendv, stream, stream_fd
6    :undoc-members:
7
8 `JournalHandler` class
9 ----------------------
10
11 .. autoclass:: JournalHandler
12
13 Accessing the Journal
14 ---------------------
15
16 .. autoclass:: _Reader
17    :undoc-members:
18    :inherited-members:
19
20 .. autoclass:: Reader
21    :undoc-members:
22    :inherited-members:
23
24    .. automethod:: __init__
25
26 .. autoclass:: Monotonic
27
28 .. autoattribute:: systemd.journal.DEFAULT_CONVERTERS
29
30 Example: polling for journal events
31 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32
33 This example shows that journal events can be waited for (using
34 e.g. `poll`). This makes it easy to integrate Reader in an external
35 event loop:
36
37   >>> import select
38   >>> from systemd import journal
39   >>> j = journal.Reader()
40   >>> j.seek_tail()
41   >>> p = select.poll()
42   >>> p.register(j, select.POLLIN)
43   >>> p.poll()
44   [(3, 1)]
45   >>> j.get_next()
46
47
48 Journal access types
49 ~~~~~~~~~~~~~~~~~~~~
50
51 .. autoattribute:: systemd.journal.LOCAL_ONLY
52 .. autoattribute:: systemd.journal.RUNTIME_ONLY
53 .. autoattribute:: systemd.journal.SYSTEM_ONLY
54
55 Journal event types
56 ~~~~~~~~~~~~~~~~~~~
57
58 .. autoattribute:: systemd.journal.NOP
59 .. autoattribute:: systemd.journal.APPEND
60 .. autoattribute:: systemd.journal.INVALIDATE