Our pants repo has a number of processes which bui...
# plugins
d
Our pants repo has a number of processes which build PEX files and then invoke those PEX files using
VenvPexProcess
and
ProcessResult
. Currently, we just do this after we get the `ProcessResult`:
Copy code
print(result.stdout.decode())
print(result.stderr.decode())
This is great and all, but is there a way to output log lines as they're being produced? This would be super useful for long-running processes
b
https://github.com/pantsbuild/pants/issues/11056 is a relevant issue; it looks like @gorgeous-winter-99296 might be an interesting person to talk to
👍 1
g
I have a prototype for that, mostly haven't had time to land it! And it was super-hacky. Pex is extra funky since it doesn't output much in terms of logs by default anyways.
Next week I'm on MOTW rotation and maybe life is slightly more calm so will see if I can clean up and land it. It's something I sorely miss as well.
❤️ 1
🤞 2
d
Neat. So if I'm understanding things properly, we don't have a way of streaming output log lines from running processes in pants today, but might have this capability in a future release?
g
Correct! There's two different things being discussed in terms of log-streaming. I'm primarily interested in "short-form" streaming-to-console, but that issue specifically I think is more long-form/complete logs to a browser or other viewer. My prototype started looking at long-form but pivoted towards short-form because it requires less "moving parts", i.e., we already have TUI that can do short-form streaming. The other one requires a server of some sort that gathers logs, which can amount to significant amounts of storage and more complex runtime.