mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
systemd-python: add Journal method to add MESSAGE_ID match
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
6d0c634ca3
commit
89d9a23389
@@ -183,6 +183,15 @@ class Journal(_Journal):
|
||||
else:
|
||||
raise ValueError("Log level must be 0 <= level <= 7")
|
||||
|
||||
def messageid_match(self, messageid):
|
||||
"""Sets match filter for log entries for specified `messageid`.
|
||||
`messageid` can be string or UUID instance.
|
||||
Standard message IDs can be found in systemd.id128
|
||||
Equivalent to add_match(MESSAGE_ID=`messageid`)."""
|
||||
if isinstance(messageid, _uuid.UUID):
|
||||
messageid = messageid.get_hex()
|
||||
self.add_match(MESSAGE_ID=messageid)
|
||||
|
||||
def this_boot(self, bootid=None):
|
||||
"""Add match for _BOOT_ID equal to current boot ID or the specified boot ID.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user