You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing Gradle Plugin. I have to use coroutines, that write output within task execution label like this: > Task :my-task.
But it does not work, and coroutines' output goes beyond this label.
I watched Gradle Logging API. There was a function seems to solve my problem: LoggingManager.captureStandardOutput(LogLevel level). But it does not work as I expected.
Expected Behavior
Coroutines' output will be within task execution scope.
Current Behavior
Coroutines' output appears outside of task execution scope, usually above.
There are output examples in README.md in the project I attach to issue below.
Addition
I have shown in the example below achieving behaviour what I expected using Task Logger. Would not it be better if there
will be more examples in documentation using logger, not standard println. API Users will keep in mind
to use logger instead of println. I had lost a lot of time trying to figure out what is happening in
my code and why.
I think that examples in the documentation should be rewritten using logger. For example there and there.
Actually the same problem will appear if you will try to use java.lang.Thread to write in stdout.
Issue: Missing task output without using logger.
I am developing Gradle Plugin. I have to use coroutines, that write output within task execution label like this:
> Task :my-task
.But it does not work, and coroutines' output goes beyond this label.
I watched Gradle Logging API. There was a function seems to solve my problem: LoggingManager.captureStandardOutput(LogLevel level). But it does not work as I expected.
Expected Behavior
Coroutines' output will be within task execution scope.
Current Behavior
Coroutines' output appears outside of task execution scope, usually above.
There are output examples in README.md in the project I attach to issue below.
Addition
I have shown in the example below achieving behaviour what I expected using Task Logger. Would not it be better if there
will be more examples in documentation using logger, not standard
println
. API Users will keep in mindto use logger instead of
println
. I had lost a lot of time trying to figure out what is happening inmy code and why.
I think that examples in the documentation should be rewritten using logger. For example there and there.
Actually the same problem will appear if you will try to use
java.lang.Thread
to write in stdout.Steps to Reproduce
I did a little example to show it.
You have actually to build&publish plugin & to hook it up to any project, and call
./gradlew my-task
The text was updated successfully, but these errors were encountered: