mozilla / memchaser

Firefox extension to chase the memory usage and garbage collector activity
https://wiki.mozilla.org/QA/Automation_Services/Projects/Addons/MemChaser
29 stars 23 forks source link

Promise Logger #219

Open xabolcs opened 9 years ago

xabolcs commented 9 years ago

From PR #211.

whimboo added a note 23 hours ago:

So the best way here would be to refactor the methods and let _writeAsync() return the promise, and not let it call a callback. That way you can better evaluate the result of the write operation, directly in the test and without all those workarounds.

xabolcs commented on Mar 6:

whimboo, I'm asking here for permission to rewrite Logger to use Promises. So at least Logger.stop and Logger.log would change. And all logging related tests, of course. Testing with Promises isn't too trivial, but not too hard. :) See addon-sdk/test/test-promise.js for example!

Ok, I tried it, and doesn't work for me. Only _writeAsync should be asynchronous. So I'm going to do something with the callbacks to make it usable again.