clarify
clarify copied to clipboard
Feature Request: API to Deinitialize
hi,
It'd be very useful to be able to deinitialize clarify and trace. I've been experimenting with using clarify/trace in some test tools, but I need to support enable or disabling them and writing tests against both scenarios. Having an init/shutdown instead of just require('clarify') or require('trace') would be beautiful.
Also I'm targeting code that is generally for running in Electron so it may be useful to add additional filters for it's internal functions as well. But I'll see if that actually matters in practice first and follow up.
Adding an enable and a disable function would be fine, if require('clarify') enables immediately such node -r clarify is possible.
The same could perhaps be done for trace, but this is much more complicated. In trace one need to continuously collect the stack trace for every async operation, if one suddenly stops doing this and resumes later, the stack trace will be incomplete.
As for Electron see https://github.com/AndreasMadsen/clarify/issues/6
Adding an enable and a disable function would be fine, if require('clarify') enables immediately such node -r clarify is possible.
Ah right, forgot your use case was to make it easy to just pass it and it auto instruments. Enable by on first require wouldn't be so bad. Will think about it some more.
The same could perhaps be done for trace, but this is much more complicated. In trace one need to continuously collect the stack trace for every async operation, if one suddenly stops doing this and resumes later, the stack trace will be incomplete.
Yes, understood. My use case would be to run some sets of async code in tests with variations of with/without clarify/trace and some other modules I'm playing with. So I assume as long as it's enabled again before I start the string of async calls per test that it would capture things as I'd expect. I'll try it out and see if there is something I'm not considering.
Excellent, thanks.
As for Electron see #6