From 6115b451ea54bfdc4b58b96d9e552beec4e4ce94 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 2 Jun 2014 00:43:03 +0300 Subject: [PATCH] asyncio_micro: Clean up logging. --- asyncio_micro/asyncio_micro.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/asyncio_micro/asyncio_micro.py b/asyncio_micro/asyncio_micro.py index 46fc6058..733e679f 100644 --- a/asyncio_micro/asyncio_micro.py +++ b/asyncio_micro/asyncio_micro.py @@ -44,7 +44,7 @@ class EventLoop: while True: if self.q: t, cnt, cb, args = heapq.heappop(self.q) - log.debug("Next task to run: %s", (t, cnt, cb, args)) + log.debug("Next coroutine to run: %s", (t, cnt, cb, args)) # __main__.mem_info() tnow = self.time() delay = t - tnow @@ -61,9 +61,9 @@ class EventLoop: try: if args == (): args = (None,) - log.debug("Gen %s send args: %s", cb, args) + log.debug("Coroutine %s send args: %s", cb, args) ret = cb.send(*args) - log.debug("Gen %s yield result: %s", cb, ret) + log.debug("Coroutine %s yield result: %s", cb, ret) if isinstance(ret, SysCall): if isinstance(ret, Sleep): delay = ret.args[0] @@ -86,10 +86,9 @@ class EventLoop: # Just reschedule pass else: - print(ret, type(ret)) - assert False + assert False, "Unsupported coroutine yield value: %r (of type %r)" % (ret, type(ret)) except StopIteration as e: - log.debug("Gen finished: %s", cb) + log.debug("Coroutine finished: %s", cb) continue self.call_later(delay, cb, *args)