summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytyt-yt <git@ytyt.yt>2018-05-23 12:30:21 -0700
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-06-16 15:13:10 +0200
commit20e0f72d402c8b8265b19ffaf64ba19e2c31a159 (patch)
tree0d60b38109e71634a29578c884103d7fc7b4b9ff
parent216f99056534a686a2c980e8c54686063424f871 (diff)
downloadpython-systemd-20e0f72d402c8b8265b19ffaf64ba19e2c31a159.tar.gz
add JournalHandler usage in README
-rw-r--r--README.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4d6daae..ce41389 100644
--- a/README.md
+++ b/README.md
@@ -85,6 +85,14 @@ Notes:
This might happen if there are no arguments or one of them is
invalid.
+A handler class for the Python logging framework is also provided:
+
+ import logging
+ from systemd import journal
+ logger = logging.getLogger('custom_logger_name')
+ logger.addHandler(journal.JournalHandler())
+ logger.warning("Some message: %s", 'detail')
+
Documentation
=============