Byron / prodash

report progress of concurrent applications and display it in various ways
https://docs.rs/prodash
MIT License
354 stars 9 forks source link

Ability to write raw Messages #8

Open stuhood opened 2 years ago

stuhood commented 2 years ago

Thanks a lot for writing prodash! Over in https://github.com/pantsbuild/pants, we have log formatting and construction that we'd like to stick with while considering moving to prodash::line for rendering running work.

To do that without tearing down the UI for each "raw" stderr output, it seems like it might makes sense to support sending "raw" (unfiltered/unleveled) Messages, which would not be interpreted by the renderer at all, except to dump them.

Would a patch to support un-interpreted Messages be welcome? We would also likely need to add a message buffer to the root, to guarantee that there was a live buffer even when no work was being rendered.

Byron commented 2 years ago

Thanks for your interest!

Raw message support seems like a useful feature that many potential users of the library crate would want, so a patch would be very welcome.

Please note that the there is a message buffer already, and as long as its big enough all messages will appear on screen. If the program emits too many messages, some messages might be overwritten before being rendered unless the buffer is big enough.

stuhood commented 2 years ago

Please note that the there is a message buffer already, and as long as its big enough all messages will appear on screen. If the program emits too many messages, some messages might be overwritten before being rendered unless the buffer is big enough.

Ah, got it. I missed that each Item's messages are just cloned references to a single buffer.

Thanks!

stuhood commented 2 years ago

I've posted a draft to https://github.com/Byron/prodash/pull/9 : none of the tests have been updated yet, (nor has the tui renderer), but it appears to be working with the line renderer. I'll need to investigate other blocking issues before resuming the patch, but let me know if you see anything wrong with the approach! Thanks.