summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-28 19:53:42 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-28 20:05:12 -0500
commit37d3ab1b7e114f0fb6dfb2e7273569b42794b76a (patch)
treeb69f73466e4719b6f02d4b30fcaa42ec43f1c40d /src/journal/journalctl.c
parent54c31a79f72ff57ac8eba089acacc4ab482b745d (diff)
parent7f41820b07ccb8a6da5552c466818fcce3d085bf (diff)
Merge branch 'python-systemd-reader'
* python-systemd-reader: python-systemd: rename Journal to Reader build-sys: upload python documentation to freedesktop.org systemd-python: add Journal class for reading journal python: build html docs using sphinx journalct: also print Python code in --new-id python: utilize uuid.UUID in logging python: add systemd.id128 module ... and 34 other commits In short: python module systemd.id128 is added, and existing systemd.journal gains a new class systemd.journal.Reader, which can be used to iterate over journal entries. Documentation is provided, and accessible under e.g. pydoc3 systemd.journal.Reader or firefox http://www.freedesktop.org/software/systemd/man/python-systemd/
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 0b3a79bee9..9084509704 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -462,14 +462,17 @@ static int generate_new_id128(void) {
"As UUID:\n"
"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n\n"
"As macro:\n"
- "#define MESSAGE_XYZ SD_ID128_MAKE(",
+ "#define MESSAGE_XYZ SD_ID128_MAKE(",
SD_ID128_FORMAT_VAL(id),
SD_ID128_FORMAT_VAL(id));
-
for (i = 0; i < 16; i++)
printf("%02x%s", id.bytes[i], i != 15 ? "," : "");
+ fputs(")\n\n", stdout);
- fputs(")\n", stdout);
+ printf("As Python constant:\n"
+ ">>> import uuid\n"
+ ">>> MESSAGE_XYZ = uuid.UUID('" SD_ID128_FORMAT_STR "')\n",
+ SD_ID128_FORMAT_VAL(id));
return 0;
}