erdewit/nest_asyncio

Lost Logs

Closed this issue · 1 comments

Hello,

Once I've applied the patch as in the docs:

import nest_asyncio
nest_asyncio.apply()

When I later ran some code that calls asyncio.run(some_coroutine), which has logging, I didn't get any of the logs from the jupyter notebook cells, except for the logger.exception(some_msg) calls.

It works for me. The log level must higher than INFO for it to be shown by default in Jupyter.

import nest_asyncio
nest_asyncio.apply()
import logging
import asyncio

async def coro():
    logging.warning('OK')
    await asyncio.sleep(0.1)
    
asyncio.run(coro())