Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to switch deinit warning message off by default #23

Open
ghost opened this issue Mar 15, 2016 · 1 comment
Open

Make it possible to switch deinit warning message off by default #23

ghost opened this issue Mar 15, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 15, 2016

This message: PromiseSource.deinit: WARNING: Unresolved PromiseSource deallocated, maybe retain this object? appears in our test suite log often, which makes the test results difficult to read. The warning is useful in a production context, but not while testing. It would be nice to be able to disable the warning globally. Although we could disable the warning on an instance-by-instance basis, we would prefer to not need to change the construction of promises throughout the codebase.

@tomlokhorst
Copy link
Owner

Hmm... interesting, I've asked around a bit, but none of my colleagues at Q42 have run in to this exact issue.
In test environments we already have a bunch of switches to change things from production. So perhaps that's why this never came up.

Thinking about this, I can't think of a way of changing the default warning, without introducing global mutable state, which in my opinion is a bad idea. Do you have a proposed solution?

I'm working on improving the deinit warnings. Where next to the print, you can also set it to either a fatalError, or add a callback. Perhaps that's also of use to you?

Thanks for using Promissum and taking the time to create this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant