Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-2215

Allow configuring of the test "showStandardStreams" logging

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1-rc-1
  • Gradle Forums topic Reference:

    idea - Allow configuring of the test “showStandardStreams” logging (complete)

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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Remote Attachments
  • Commits
  • Source
  • Reviews
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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.

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM 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.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM 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
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM We believe that build tool output should be minimal by default. Otherwise it will quickly turn into constant noise that nobody cares about.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM I agree that it should be minimal by default. That doesn't mean it should be hard to display it when needed.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM What's hard about it? It's a one-liner.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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.

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM 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.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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.

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM 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.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM What's in the -i output that you need?
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM -i was the only way I could see my tests' log output. Adding the test.testLogging.showStandardStreams = true was not enough.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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.

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM 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.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

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

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM Sorry - I didn't mean to come across as prickly. I totally understand.
Hide
Permalink
Gradle Forums added a comment - 05/Apr/12 1:06 PM

No probs at all.

Show
Gradle Forums added a comment - 05/Apr/12 1:06 PM No probs at all.
Hide
Permalink
Justin Ryan added a comment - 05/Apr/12 1:21 PM

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

Show
Justin Ryan added a comment - 05/Apr/12 1:21 PM Gradle would benefit from a generalized way of controlling logging. E.g. I really want to turn off wharf logging in --debug mode.
Hide
Permalink
Peter Niederwieser added a comment - 05/Apr/12 4:09 PM

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

Show
Peter Niederwieser added a comment - 05/Apr/12 4:09 PM INFO is a bad default. "test.testLogging.showStandardStreams = true" should be enough to see the output - meaning it should be logged at level LIFECYCLE.
Hide
Permalink
Szczepan Faber added a comment - 10/Apr/12 12:26 PM

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.

Show
Szczepan Faber added a comment - 10/Apr/12 12:26 PM 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.
Hide
Permalink
Peter Niederwieser added a comment - 10/Apr/12 2:07 PM

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.

Show
Peter Niederwieser added a comment - 10/Apr/12 2:07 PM 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.
Hide
Permalink
Szczepan Faber added a comment - 10/Apr/12 2:56 PM

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

Show
Szczepan Faber added a comment - 10/Apr/12 2:56 PM Ok, I'm sold. Let's change the default.
Hide
Permalink
Peter Niederwieser added a comment - 13/Apr/12 6:45 PM - edited

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

Show
Peter Niederwieser added a comment - 13/Apr/12 6:45 PM - edited Maybe "quiet" would be an even better default than "lifecycle". Would make it the same as for println's in build scripts. Unsure.
Hide
Permalink
Szczepan Faber added a comment - 14/Apr/12 5:52 AM

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...

Show
Szczepan Faber added a comment - 14/Apr/12 5:52 AM 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...

People

  • Assignee:
    Unassigned
    Reporter:
    Gradle Forums
Vote (1)
Watch (3)

Dates

  • Created:
    05/Apr/12 1:06 PM
    Updated:
    04/Jan/13 5:09 AM
    Resolved:
    25/Jun/12 3:27 PM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.