Skip to main content

Non-blocking asyncio handlers for Python logging.

Project description

noblklog

Keep using the logging you're accustomed to, without having to fear it blocking your asyncio event loop.

import asyncio
import logging
import noblklog

logging.basicConfig(
    level=logging.INFO,
    handlers=[
        noblklog.AsyncStreamHandler(),
    ],
)
log = logging.getLogger(None)

log.info('It is logging synchronously outside an event loop! Magic!')

async def main():
    log.info('And asynchronously inside an event loop! Even more magic!')

asyncio.run(main())

For more details see the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

noblklog-0.5.tar.gz (12.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page