Coming Up for Air

Gradle Tip: Seeing Standard Streams During Tests

Tuesday, September 10, 2013 |

I’m not a real big fan of using standard out as a debugging strategy (I prefer an IDE and break points, for what it’s worth), but there are times when it’s either necessary or just convenient. The standard Gradle configuration, though, makes this a bit more difficult than it probably should be. Fortunately, Gradle also makes it easy to change:

build.gradle
1
2
3
test {
    testLogging.showStandardStreams = true
}

If you’d like to make this change globally, that’s also easy:

$HOME/.gradle/init.gradle
1
2
3
4
5
allprojects {
    tasks.withType(Test) {
        testLogging.showStandardStreams = true
    }
}

Search

    Quotes

    Sample quote

    Quote source

    About

    My name is Jason Lee. I am a software developer living in the middle of Oklahoma. I’ve been a professional developer since 1997, using a variety of languages, including Java, Javascript, PHP, Python, Delphi, and even a bit of C#. I currently work for Red Hat on the WildFly/EAP team, where, among other things, I maintain integrations for some MicroProfile specs, OpenTelemetry, Micrometer, Jakarta Faces, and Bean Validation. (Full resume here. LinkedIn profile)

    I am the president of the Oklahoma City JUG, and an occasional speaker at the JUG and a variety of technical conferences.

    On the personal side, I’m active in my church, and enjoy bass guitar, running, fishing, and a variety of martial arts. I’m also married to a beautiful woman, and have two boys, who, thankfully, look like their mother.

    My Links

    Publications