Allow configuring of the test “showStandardStreams” logging


(Jordan Zimmerman) #1

I’ve tried everything, searched the docs, etc. When I run tests in IntelliJ I see my log output (using slf4j) just fine. No matter what I do I can’t get any log output (to a file, to the console, anything) from Gradle.


(Jordan Zimmerman) #2

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.


(Jordan Zimmerman) #3

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 :frowning:


(Peter Niederwieser) #4

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


(Jordan Zimmerman) #5

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


(Peter Niederwieser) #6

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


(Jordan Zimmerman) #7

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.


(Jordan Zimmerman) #8

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.


(Luke Daley) #9

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


(Jordan Zimmerman) #10

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


(Luke Daley) #11

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.


(Jordan Zimmerman) #12

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


(Luke Daley) #13

No probs at all.


(Luke Daley) #14

I went looking and couldn’t find an issue for configurability of the test standard stream logging.

I’ve raised GRADLE-2215 and linked to this topic to track it. I’ll also convert it to an idea and reword the subject slightly.


(Gradle Jira) #15

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


(Gradle Jira) #16

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


(Szczepan Faber) #17

@Jordan, you can implement test.onOutput {} or add your own TestOutputListener and print test outputs at whatever log level you please.

Hope that helps!