Skip to content

global stream debug switch #5

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

Open
davidmarkclements opened this issue Aug 22, 2014 · 1 comment
Open

global stream debug switch #5

davidmarkclements opened this issue Aug 22, 2014 · 1 comment

Comments

@davidmarkclements
Copy link

It would be really nice to be able to do this,

   require('vstream').wrap({streams:true, transforms: false});

Now every stream has been instrumented, but not transforms
You would have to modify prototypes to achieve this, but arguably,
that's permissible in this situation as it's for development/debug purposes
and won't make it to production

@davidmarkclements
Copy link
Author

You could add to this still, maybe do it like

   require('vstream')({streams:true, transforms: false}).debug();

Where the call to vstream() actually attaches no-ops to all the methods
you might use (vsWarn etc.) and then the .debug call swaps out the
no-ops for the real deal - this means you don't have to go an uncomment
all your debug code if you just want to switch debug off for a moment

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