Issue
My python process listens for files events and trigger an async task.
When a task runs the following output is written to stderr
:
Executing <Task pending coro=<process_file() running at /home/adona/SINT/watcher.py:86> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fea5cb0b078>()] created at /usr/lib/python3.6/asyncio/base_events.py:295> created at /home/adona/SINT/watcher.py:67> took 0.350 seconds
Executing <Handle <TaskWakeupMethWrapper object at 0x7fea5e3d7af8>(<Future finis...events.py:295>) created at /home/adona/SINT/penv/lib/python3.6/site-packages/aiohttp/helpers.py:667> took 0.436 seconds
Executing <Handle <TaskWakeupMethWrapper object at 0x7fea5cb0b258>(<Future finis...events.py:295>) created at /home/adona/SINT/penv/lib/python3.6/site-packages/aiohttp/helpers.py:667> took 0.124 seconds
To me it seems a debug o inform message, not a warning or a problem, but please correct me if I'm wrong.
Is there a way to disable python to write on stderr
these messages?
The line 86 at watcher.py
:
async for df in sint.FEEDER.upload(pname): # line 86
if not isinstance(df, pd.DataFrame):
raise Exception(
'internal error: file parser does not returns a dataframe')
Solution
The message is a warning: an async task executed for a long time without yielding control to the event loop.
If this is acceptable and you want avoid this message, set the log level of asyncio
package to ERROR:
# disable the asyncio "Executing took ... seconds" warning
logging.getLogger('asyncio').setLevel(logging.ERROR)
Answered By - attdona
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.