diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2018-09-30 05:28:40 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-09-30 05:28:40 (GMT) |
commit | d5bd036138881bb90a803397d992870a46fbdc2d (patch) | |
tree | 5375a0724482a249efa43a963d55ddf9ba9ec709 /Lib/asyncio/base_events.py | |
parent | df8101517aa1c917fdf8aeb466e480c26d4e878c (diff) | |
download | cpython-d5bd036138881bb90a803397d992870a46fbdc2d.zip cpython-d5bd036138881bb90a803397d992870a46fbdc2d.tar.gz cpython-d5bd036138881bb90a803397d992870a46fbdc2d.tar.bz2 |
bpo-34849: Don't log wating for selector.select in asyncio loop iteration (GH-9641)
The waiting is pretty normal for any asyncio program, logging its time just adds
a noise to logs without any useful information provided.
https://bugs.python.org/issue34849
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 492e377..780a061 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -1719,28 +1719,7 @@ class BaseEventLoop(events.AbstractEventLoop): when = self._scheduled[0]._when timeout = min(max(0, when - self.time()), MAXIMUM_SELECT_TIMEOUT) - if self._debug and timeout != 0: - t0 = self.time() - event_list = self._selector.select(timeout) - dt = self.time() - t0 - if dt >= 1.0: - level = logging.INFO - else: - level = logging.DEBUG - nevent = len(event_list) - if timeout is None: - logger.log(level, 'poll took %.3f ms: %s events', - dt * 1e3, nevent) - elif nevent: - logger.log(level, - 'poll %.3f ms took %.3f ms: %s events', - timeout * 1e3, dt * 1e3, nevent) - elif dt >= 1.0: - logger.log(level, - 'poll %.3f ms took %.3f ms: timeout', - timeout * 1e3, dt * 1e3) - else: - event_list = self._selector.select(timeout) + event_list = self._selector.select(timeout) self._process_events(event_list) # Handle 'later' callbacks that are ready. |