-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature request: mute #8
Comments
Not returning in the interceptor should work, shouldn't it? |
I think SimenB is basically right, you can see the first example (output is muted) in the README compared to the 2nd one under the modification section (the 'intercepter' returns a manipulated string). Although, I think process.stdout.write is still being called regardless, but I am not sure this has an effect. |
@SimenB Nor sure what you mean by Not returning in the interceptor. Commenting out @sfarthin But the log is not muted in the first example. The part below logs a and b.
Nevermind. I made something that mutes the log (although I think I lost the streaming aspect but that's fine by me). |
@karlpokus correct. @sfarthin was talking about 2nd example in the readme. It's not obvious from the readme, but after studying tests I realised that to suppress output empty string should be returned (not let unhook_intercept = intercept(function (line) {
// ...
return ''
}) @sfarthin could be useful to mention that not returning a string will result in print of the original string. |
Sounds good, would you mind doing a PR? |
This sort of can be closed. The readme has the info but on the npm site, the changes to the readme are not there. |
Thanks for sharing your module! I'm looking for a way to both intercept and mute the log. By commenting out this line I think it would work.
Would you be interested in a PR or should I fork?
The text was updated successfully, but these errors were encountered: