Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Promise Logger #219

@xabolcs

Description

@xabolcs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions