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.
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.
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
We believe that build tool output should be minimal by default. Otherwise it will quickly turn into constant noise that nobody cares about.
I agree that it should be minimal by default. That doesn’t mean it should be hard to display it when needed.
What’s hard about it? It’s a one-liner.
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.
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.
What’s in the -i output that you need?
-i was the only way I could see my tests’ log output. Adding the test.testLogging.showStandardStreams = true was not enough.
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.
Sorry - I didn’t mean to come across as prickly. I totally understand.
No probs at all.
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 would benefit from a generalized way of controlling logging. E.g. I really want to turn off wharf logging in --debug mode.
INFO is a bad default. “test.testLogging.showStandardStreams = true” should be enough to see the output - meaning it should be logged at level LIFECYCLE.
@Jordan, you can implement test.onOutput {} or add your own TestOutputListener and print test outputs at whatever log level you please.
Hope that helps!