asyncio_micro: Clean up logging.

pull/11/head
Paul Sokolovsky 2014-06-02 00:43:03 +03:00
rodzic 4af1cf5a30
commit 6115b451ea
1 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -44,7 +44,7 @@ class EventLoop:
while True: while True:
if self.q: if self.q:
t, cnt, cb, args = heapq.heappop(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() # __main__.mem_info()
tnow = self.time() tnow = self.time()
delay = t - tnow delay = t - tnow
@ -61,9 +61,9 @@ class EventLoop:
try: try:
if args == (): if args == ():
args = (None,) args = (None,)
log.debug("Gen %s send args: %s", cb, args) log.debug("Coroutine %s send args: %s", cb, args)
ret = cb.send(*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, SysCall):
if isinstance(ret, Sleep): if isinstance(ret, Sleep):
delay = ret.args[0] delay = ret.args[0]
@ -86,10 +86,9 @@ class EventLoop:
# Just reschedule # Just reschedule
pass pass
else: else:
print(ret, type(ret)) assert False, "Unsupported coroutine yield value: %r (of type %r)" % (ret, type(ret))
assert False
except StopIteration as e: except StopIteration as e:
log.debug("Gen finished: %s", cb) log.debug("Coroutine finished: %s", cb)
continue continue
self.call_later(delay, cb, *args) self.call_later(delay, cb, *args)