I am trying to use Gradle’s internal ProgressLogger
and ProgressLoggerFactory
in order to produce some useful logs in my plugin. I am able to get a ProgressLogger
instance and write out some logs but sometimes I’ve observed that the logs get concatenated to each other with a >
character as a separator. For example:
<===========--> 90% EXECUTING [16s]
> :test > Running test testHelloWorld > 5 tests completed
> :test > Executing test com.adarshr.gradle.test.SecondSpec
In the above example, the text Running test testHelloWorld
is the only message I intend to print, in its own dedicated line. The lines 5 tests completed
and Executing test com.adarshr.gradle.test.SecondSpec
are from Gradle. Now I don’t understand what makes the progress message from my ProgressLogger
instance to get prepended to the standard Gradle message. Sometimes it can even appear after the Gradle message. For clarity, I don’t want to remove Gradle’s messages would like to have more control over where my message ends up. I understand the progress logging is currently not part of a public API but unfortunately, I have to use it.
I tried to mine for this logic through Gradle source code, but so far I have been unsuccessful. If someone can point me in the right direction - sample code and/or design docs for this behaviour I would really appreciate it.