aiologger
aiologger copied to clipboard
In docs same code in Lazy initialization and Using aiologger with the async/await syntax sections
In usage https://async-worker.github.io/aiologger/usage.html in Lazy initialization the code example exactly the same as in Using aiologger with the async/await syntax Probably it is mistake.
import asyncio
from aiologger import Logger
async def main():
logger = Logger.with_default_handlers(name='my-logger')
await logger.debug("debug at stdout")
await logger.info("info at stdout")
await logger.warning("warning at stderr")
await logger.error("error at stderr")
await logger.critical("critical at stderr")
await logger.shutdown()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()