Python systemd wrapper
Project description
Python systemd wrapper using Cython
Systemd daemon notification
from systemd.daemon import notify, Notification
# Send READY=1
notify(Notification.READY)
# Send status
notify(Notification.STATUS, "I'm fine.")
# Send stopping
notify(Notification.STOPPING)
Write message into Systemd journal
from systemd import journal
journal.write("Hello Lennart")
Or add logging handler to python logger
import logging
import uuid
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()
logger.addHandler(JournaldLogHandler())
try:
log.info("Trying to do something")
raise Exception('foo')
except:
logger.exception("Test Exception %s", 1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
systemd-0.8.7.tar.gz
(76.6 kB
view details)
File details
Details for the file systemd-0.8.7.tar.gz
.
File metadata
- Download URL: systemd-0.8.7.tar.gz
- Upload date:
- Size: 76.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3456c5638d6051b012be4cbe85daf45957219dd039032f30d830b5b55c0071c1 |
|
MD5 | 47ab58019e064620e6f72c430ce5cfc5 |
|
BLAKE2b-256 | 03b48fe6cb41897476d10985ca86a285b58296a93258f246e1a2244463901ac7 |