diff options
author | ytyt-yt <git@ytyt.yt> | 2018-05-23 12:30:21 -0700 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-06-16 15:13:10 +0200 |
commit | 20e0f72d402c8b8265b19ffaf64ba19e2c31a159 (patch) | |
tree | 0d60b38109e71634a29578c884103d7fc7b4b9ff | |
parent | 216f99056534a686a2c980e8c54686063424f871 (diff) | |
download | python-systemd-20e0f72d402c8b8265b19ffaf64ba19e2c31a159.tar.gz |
add JournalHandler usage in README
-rw-r--r-- | README.md | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 ============= |