chiark / gitweb /
Remove src/path
[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 .. autofunction:: _get_catalog
27 .. autofunction:: get_catalog
28
29 .. autoclass:: Monotonic
30
31 .. autoattribute:: systemd.journal.DEFAULT_CONVERTERS
32
33 Example: polling for journal events
34 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35
36 This example shows that journal events can be waited for (using
37 e.g. `poll`). This makes it easy to integrate Reader in an external
38 event loop:
39
40   >>> import select
41   >>> from systemd import journal
42   >>> j = journal.Reader()
43   >>> j.seek_tail()
44   >>> p = select.poll()
45   >>> p.register(j, j.get_events())
46   >>> p.poll()
47   [(3, 1)]
48   >>> j.get_next()
49
50
51 Journal access types
52 ~~~~~~~~~~~~~~~~~~~~
53
54 .. autoattribute:: systemd.journal.LOCAL_ONLY
55 .. autoattribute:: systemd.journal.RUNTIME_ONLY
56 .. autoattribute:: systemd.journal.SYSTEM
57 .. autoattribute:: systemd.journal.CURRENT_USER
58
59 Journal event types
60 ~~~~~~~~~~~~~~~~~~~
61
62 .. autoattribute:: systemd.journal.NOP
63 .. autoattribute:: systemd.journal.APPEND
64 .. autoattribute:: systemd.journal.INVALIDATE