[GRADLE-2215] Allow configuring of the test "showStandardStreams" logging Created: 05/Apr/12  Updated: 04/Jan/13  Resolved: 25/Jun/12

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.1-rc-1

Type: Improvement
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 1


 Description   

At the moment it's hardcoded to INFO. It might be worth making this configurable, but that would probably mean moving other logging (e.g what test is actually running) as well.



 Comments   
Comment by Gradle Forums [ 05/Apr/12 ]

Getting closer...

I added
test.testLogging.showStandardStreams = true

And am running with -d. But, that shows all of Gradle's logging which I don't care about it. I'll see if I can figure out how to turn that off.

Comment by Gradle Forums [ 05/Apr/12 ]

Looks like running with -i does better. So, to summarize:

Add "test.testLogging.showStandardStreams = true" to build.gradle and run with "-i". Yet again, Gradle comes out more cumbersome than Maven

Comment by Gradle Forums [ 05/Apr/12 ]

We believe that build tool output should be minimal by default. Otherwise it will quickly turn into constant noise that nobody cares about.

Comment by Gradle Forums [ 05/Apr/12 ]

I agree that it should be minimal by default. That doesn't mean it should be hard to display it when needed.

Comment by Gradle Forums [ 05/Apr/12 ]

What's hard about it? It's a one-liner.

Comment by Gradle Forums [ 05/Apr/12 ]

It's not really a one liner. You add the line and then have to add "-i" to your CLI. "-i" will also show any Gradle INFOs which is not what is desired. Further, finding the doc on how to do this took me an hour. Lastly, the output is pretty ugly, lots of extra lines, etc.

Comment by Gradle Forums [ 05/Apr/12 ]

Oh - also - if I leave that line in my build script I will forever see exceptions in the Gradle output. In the normal case, I like the minimal output.

Comment by Gradle Forums [ 05/Apr/12 ]

What's in the -i output that you need?

Comment by Gradle Forums [ 05/Apr/12 ]

-i was the only way I could see my tests' log output. Adding the test.testLogging.showStandardStreams = true was not enough.

Comment by Gradle Forums [ 05/Apr/12 ]

Ok, now I see. It is indeed hardcoded to info level. Raising a clear improvement request clearly explaining the current vs. desired behaviour would be the most productive way to get this issue addressed.

I understand you are passionate about this particular issue. Bear in mind that we have to juggle lots of issues and improvements and have to prioritise.

If you do want something improved, raising a request as I said above is the most effective way to do it. You are of course free to make comparisons and frowny faces, but it's not likely to be the most effective way of getting the feature you want.

Comment by Gradle Forums [ 05/Apr/12 ]

Sorry - I didn't mean to come across as prickly. I totally understand.

Comment by Gradle Forums [ 05/Apr/12 ]

No probs at all.

Comment by Justin Ryan [ 05/Apr/12 ]

Gradle would benefit from a generalized way of controlling logging. E.g. I really want to turn off wharf logging in --debug mode.

Comment by Peter Niederwieser [ 05/Apr/12 ]

INFO is a bad default. "test.testLogging.showStandardStreams = true" should be enough to see the output - meaning it should be logged at level LIFECYCLE.

Comment by Szczepan Faber [ 10/Apr/12 ]

Hey guys,

I think changing the default to LIFECYCLE is not the way to go. I'd rather make it configurable so that one can configure at what level he wants the streams to show. Actually, it should be already configurable because one can use onOutput {} closure or create TestOutputListener that prints to whatever log level the user wishes.

Otherwise, it's just going to be thrashing as there will be users who actually like the fact that they can toggle visibility of the test streams via -i.

That's just my POV - if you all want to change the default - I won't stop you

The docs should be updated, the info about the log level is not exposed enough.

Comment by Peter Niederwieser [ 10/Apr/12 ]

Whether to make this configurable is a separate concern, and certainly a possibility. Still, the default should change so that std err/out is visible when showStandardStreams=true. Everything else violates the principle of least surprise. Another advantage is that this allows to see just the test output, without any info logging.

In the longer run, we will need to support more fine-grained logging configuration, and setting arbitrary properties from the command line. At this point such issues will go away completely.

Comment by Szczepan Faber [ 10/Apr/12 ]

Ok, I'm sold. Let's change the default.

Comment by Peter Niederwieser [ 13/Apr/12 ]

Maybe "quiet" would be an even better default than "lifecycle". Would make it the same as for println's in build scripts. Unsure.

Comment by Szczepan Faber [ 14/Apr/12 ]

Hmmm, I think I prefer your original idea with lifecycle level. I kinda see the point with --quiet, however if someone tells Gradle explicitly 'be quiet' it should be quiet...

Generated at Wed Jun 30 12:15:51 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.