Is there a good way to stream the output of a `Pro...
# plugins
f
Is there a good way to stream the output of a
Process
to the UI? With large builds, sometimes it's helpful (or at least nice) to see the progress of the build playing out on the console
h
Yes. Let me finish those docs on Monday https://www.pantsbuild.org/docs/rules-api-logging In the meantime, do you mean specifically the results of building each package, the
await MultiGet(Get(BuiltPackage))
part? Or something else, like the
Process
that runs Docker?
f
the process that runs docker
h
Cool, you should be able to use
<http://logger.info|logger.info>(process_result.stdout.decode())
f
oh i mean more like a streaming thing
would turning dyanmic_ui off have any affect?
h
Like show it while it’s running? To do that, you’d use InteractiveProcess. You can only run one of those at a time though, and the result is never cached
f
that could make sense for my use case though
👍 1
i'll give it a try
w
there is an old change that i’d be interested in reviving to make this a bit easier: https://github.com/pantsbuild/pants/pull/8974 … it would allow a
Process
to stream its output without being Interactive(Process)
👍 1
the downside of streaming output (as it stands) though is that it means you have exclusive access to the console… we wouldn’t try to interleave the output from multiple streamed processes (something akin to `tail -f $file1 $file2, where it includes headers whenever interactive processes swap) anytime soon
f
yeah i'm not really sure what the right behavior here would be...
from a "friendly-UX" perspective, just being able to observe one of the streams while it's happening would be kinda nice
w
@flat-zoo-31952: is this usecase more like “the default for a particular tool”, or are you thinking that it might be something that someone might toggle on temporarily for debugging purposes?
(there are also middle ground approaches where every reference to a process includes a link/URL to its stdio)
👀 1
👍 1
f
more "default for long-running processes"
links would be good
when you're dealing with builds that can take a loooong time, it's good to have at least some insight into what's going on
1
w