We upgraded our project from 3.1 to 4.0 and the first thing which annoyed me was the log output.
Instead of appending each log output to new line, it now redraws the screen, which of course looks really awesome, but is not practical for me.
Luckily, you can append “–console=plain” to get the old-appending-style output.
Is it possible to make “–console=plain” the default behaviour?
For me, the appending-style has the advantage, that if something worked correctly, then I can see how far the process when, what happened before.
I think StartParameter is read only by the time you can access it in the initialization phase. According to the latest version of the Gradle source code, the only thing that could affect log output is the --console option. Your best bet would be to rely on the underlying OS and create an alias:
# GNU/Linux
alias gradle='gradle --console=plain'
# Windows (see https://stackoverflow.com/a/21040825 to make this persistent)
doskey gradle=gradle --console=plain $*
Your solutions seems to be a hacky way to solve this problem, aliasing the gradle command could lead to a lot of confusion ( like in this case for example, if I called it with gradle wrapper then it would lead to the new fancy output and with ‘gradle’ command to plain console output).
It is a hack. At the current time there is few other options. You could also repackage your own distribution for the gradle wrapper to enforce options deemed necessary or interesting in your context by changing the distributionUrl (see https://docs.gradle.org/4.0.2/userguide/gradle_wrapper.html).
The goal of logging changes are to highlight and group the most important information (taking away noise where possible).
The 4.0 CLI has an appendable section at the top above the now taller dynamic section (this used to be just 1 line in Gradle 3.4). The fundamental structure for logging hasn’t changed much but the content has.
Would you please specify what you are missing or dislike about the new CLI and logging so that we can improve those specific things? I would encourage you to adopt Gradle 4.0 as many major plugins like Spring Boot 2 will be requiring it, and you will be missing out on very significant performance gains we’ve been making.
Finally, you can force “plain” output with an environment variable TERM=dumb. There isn’t yet a way to use a Gradle property for this, but we’re more likely to consider it given specific feedback about the console.
BTW with the latest gradle version you can use -Dorg.gradle.console=plain. this is handy as you can set this property in your local gradle.properties file.
@Lance, org.gradle.console=plain is available since Gradle 4.3.
@eriwen, what I miss in the new CLI logging is that new plain mode has no color anymore. Before refactoring message like UP-TO-DATE, NO-SOURCE etc were colored. So it’s now difficult to distinguish tasks status. rich mode hides task (you see only summary), so I don’t know what tasks were executed. And new verbose mode put unnecessary line break and identical prefix for each task > Task: (but it’s really verbose cannot complain).