(I hope you don't mind, but thought I'd convert my wish here into an issue so that I can get notified if you ever do it 🙂)
You ought to release log-capture.js as a standalone module.
I've been using log-interceptor for another part of my project. It's more sophisticated (e.g. supports nested log suppression calls) but I never used any of that. The one difference that is significant is that it captures all stdout.write calls, not just console.* calls. I'm not sure that's better, though it's nice to have as an option.
In any case there are other uses for log capture / deferral / redirection beyond Mocha. log-capture.js is small, but its nice and its tested and I haven't found any great alternatives, besides log-interceptor, which is no longer maintained, and which doesn't capture each different console log level separately as log-capture does.
(I hope you don't mind, but thought I'd convert my wish here into an issue so that I can get notified if you ever do it 🙂)
You ought to release
log-capture.js
as a standalone module.I've been using log-interceptor for another part of my project. It's more sophisticated (e.g. supports nested log suppression calls) but I never used any of that. The one difference that is significant is that it captures all
stdout.write
calls, not justconsole.*
calls. I'm not sure that's better, though it's nice to have as an option.In any case there are other uses for log capture / deferral / redirection beyond Mocha.
log-capture.js
is small, but its nice and its tested and I haven't found any great alternatives, besideslog-interceptor
, which is no longer maintained, and which doesn't capture each different console log level separately aslog-capture
does.