systemd-python: add Journal class for reading journal

This commit is contained in:
Steven Hiscocks 2013-02-08 19:41:21 +00:00 committed by Zbigniew Jędrzejewski-Szmek
parent 9015fa646e
commit c4e9b5b557
3 changed files with 1186 additions and 1 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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):