mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 12:13:33 +08:00
systemd-python: add Journal class for reading journal
This commit is contained in:
parent
9015fa646e
commit
c4e9b5b557
22
Makefile.am
22
Makefile.am
@ -3381,7 +3381,8 @@ EXTRA_DIST += \
|
||||
if HAVE_PYTHON_DEVEL
|
||||
pkgpyexec_LTLIBRARIES = \
|
||||
_journal.la \
|
||||
id128.la
|
||||
id128.la \
|
||||
_reader.la
|
||||
|
||||
_journal_la_SOURCES = \
|
||||
src/python-systemd/_journal.c
|
||||
@ -3421,6 +3422,25 @@ id128_la_LIBADD = \
|
||||
$(PYTHON_LIBS) \
|
||||
libsystemd-id128.la
|
||||
|
||||
_reader_la_SOURCES = \
|
||||
src/python-systemd/_reader.c
|
||||
|
||||
_reader_la_CFLAGS = \
|
||||
$(AM_CFLAGS) \
|
||||
-fvisibility=default \
|
||||
$(PYTHON_CFLAGS)
|
||||
|
||||
_reader_la_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
-shared \
|
||||
-module \
|
||||
-avoid-version
|
||||
|
||||
_reader_la_LIBADD = \
|
||||
$(PYTHON_LIBS) \
|
||||
libsystemd-journal.la \
|
||||
libsystemd-id128.la
|
||||
|
||||
dist_pkgpyexec_PYTHON = \
|
||||
src/python-systemd/journal.py \
|
||||
src/python-systemd/__init__.py
|
||||
|
1163
src/python-systemd/_reader.c
Normal file
1163
src/python-systemd/_reader.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,8 @@ import logging as _logging
|
||||
from syslog import (LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR,
|
||||
LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG)
|
||||
from ._journal import sendv, stream_fd
|
||||
from ._reader import (Journal, NOP, APPEND, INVALIDATE,
|
||||
LOCAL_ONLY, RUNTIME_ONLY, SYSTEM_ONLY)
|
||||
|
||||
def _make_line(field, value):
|
||||
if isinstance(value, bytes):
|
||||
|
Loading…
Reference in New Issue
Block a user