Provide option to not tee output for stdout/stderr
Closed this issue · 6 comments
I'm generally quite happy with the stdout/stderr rules. There is one niggle. I prefer "clean" tests - no output in general unless they fail. Would you kindly provide an option in the rules constructor (or a factory method) to not tee output when capturing it? (I do understand this behavior comes from commons-io.)
I'm happy to fork & provide a pull patch to implement, if you wish.
@stefanbirkner Hi, I would implement this feature in PrintStreamLog
with a constructor flag. When false
to not display in original stream, use a NullOutputStream
in the TeeOutputStream
in place of the original stream.
I am sorry that you had to wait for such a long time, but I was on vacation.
I build a solution for your problem. It needs a parameter for creating the rule:
new StandardErrorStreamLog(LOG_ONLY);
The new log mode has not been choosen to be the default mode in order to keep the current behaviour if the rules are created with the default constructor.
If this is ok for you then I create a release 1.7.0 with this change.
This is great - thanks! I had intended my patch to make current behavior
the default, apologies if it was otherwise. Looking forward to next
release.
Cheers,
--binkley
On Wed, Oct 1, 2014 at 2:32 PM, Stefan Birkner notifications@github.com
wrote:
I am sorry that you had to wait for such a long time, but I was on
vacation.I build a solution for your problem. It needs a parameter for creating the
rule:new StandardErrorStreamLog(LOG_ONLY);
The new log mode has not been choosen to be the default mode in order to
keep the current behaviour if the rules are created with the default
constructor.If this is ok for you then I create a release 1.7.0 with this change.
—
Reply to this email directly or view it on GitHub
#16 (comment)
.
System Rules 1.7.0 is already available. Try it out.
Many thanks. Even more than the particulars of your library, I love that
you've opened my eyes to what can be done with @rule.
Cheers, --binkley
On Tue, Oct 7, 2014 at 5:51 PM, Stefan Birkner notifications@github.com
wrote:
System Rules 1.7.0 is already available. Try it out.
—
Reply to this email directly or view it on GitHub
#16 (comment)
.
I'm glad that I could help you.