async-worker / aiologger

Asynchronous logging for Python and asyncio
https://async-worker.github.io/aiologger/
MIT License
136 stars 13 forks source link

In docs same code in Lazy initialization and Using aiologger with the async/await syntax sections #17

Open kotofos opened 2 years ago

kotofos commented 2 years ago

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()