How to use the cysystemd.reader.JournalOpenMode function in cysystemd

To help you get started, we’ve selected a few cysystemd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mosquito / cysystemd / examples / asyncio_reader.py View on Github external
async def main():
    reader = AsyncJournalReader()
    await reader.open(JournalOpenMode.SYSTEM)
    await reader.seek_tail()

    while await reader.wait():
        async for record in reader:
            print(json.dumps(record.data, indent=1, sort_keys=True))
github mosquito / cysystemd / cysystemd / async_reader.py View on Github external
    async def open(self, flags=JournalOpenMode.CURRENT_USER):
        self.__flags = flags
        return await self._exec(self.__reader.open, flags=flags)