Show TextPort in container UI

I’ve been using the Textport to display simple progress and status info using Python print statements. Is there a way to keep the Textport visible in perform mode, or is there another recommended way to show a scrolling text log like this?

simple option: Press F4 to open Textport as a floating window. It will also work in perform mode.

For a more advanced hack: you can redirect Python stdout and stderr to any DAT. Then you can use the Op Viewer TOP or COMP to convert that DAT into a texture and integrate it into your UI.
See Rob’s example here: console in a texture? [ 099 component ] - #2 by rob

And if you want to restore output to textport:

sys.stdout = tdutils.outputcatcher.StdoutCatcher()
sys.stderr = tdutils.outputcatcher.StderrCatcher()

(These lines are in in the bin folder).

1 Like

You might want to consider logging instead. I’ve been working with a LOGGER .tox I hacked together from concepts i was first introduced to in Colin Hoy’s 2019 presentation from the montreal summit: System Design for Large Scale Installations - Colin Hoy - YouTube

@alphamoonbase has a nice logger in Olib that doesn’t rely on python’s logging, and @DavidBraun has a more pythonic version in his TD-shared components git repo. Mine cherry picks my favorite features from all three and spits them out to a field comp dashboard utility to print important bits of INFO in perform mode, with a lister based UI for filtering and sorting the log.txt when required

1 Like

thanks for citing my laziness :wink: