For this particular patch I don't see why this couldn't always be on -- it seems to only do extra work when logging this particular error condition, which shouldn't happen at all. However I do think the entire second traceback should be logged in a single logger.error() call, rather than two calls per frame. And isn't there a helper function in traceback.py that can do the formatting for you?
On Sun, Feb 9, 2014 at 2:32 PM, Victor Stinner <[email protected]>wrote: > 2014-02-09 23:23 GMT+01:00 Victor Stinner <[email protected]>: > > tracemalloc is just used to show the expected output, but I would > > prefer to record manually the traceback where a taks was created in > > Future constructor ... > > Oh, I forgot to say that it is my main motivation to add a debug > asyncio.DEBUG flag: only do such slow operations in debug mode, to not > impact performances at runtime. > > Recording the traceback when a Handle is created would also help tools > like "Log handles taking more than 1 second to be executed" ( > http://code.google.com/p/tulip/issues/detail?id=105 ). > > Victor > -- --Guido van Rossum (python.org/~guido)
