ProgressLogger not logging progress on console

I am trying to use ProgressLoggerFactory and ProgressLogger to print the status of certain operations.
The code that I currently have is:

ProjectInternal projectInternal = (ProjectInternal) getProject();
ProgressLoggerFactory progressLoggerFactory = projectInternal.getServices().get(ProgressLoggerFactory.class);
ProgressLogger progressLogger = progressLoggerFactory.newOperation(getClass());
progressLogger.start("Test Progress Logger", getName());
progressLogger.progress("10% done");
progressLogger.progress("90% done");
progressLogger.completed();

Although, it does not seem to print anything to the console.
Please let me know if I am missing something here.

Besides the obvious point, that you should better not use Gradle internal classes, it works just fine here.
Maybe you just don’t see it because you immediately pass through that code and after the progress is finished it is no longer be displayed.
If I copy your code and add a ´Thread.sleep(5000)` between the lines, I see the progress reported as expected.

1 Like

Thanks for your answer @Vampire.
I was able to see the progress while running my gradle task via the command line.
So, glad to know it works.

I am using Jetbrains IntelliJ IDEA as my IDE.
Strange thing is that, the progress I see in the command line is not seen in the IDE’s console when I run the task from IDE.

Have you noticed such issues?

That progress is probably just for command line Gradle usage.
There is also no other similar progress report from core Gradle, is there?

Okay. I don’t think there is.