Missing flush on stdout

Hello,

I’ve written an own kit agent that handles spawning new kit processes when required. My agent uses output redirection to read the console output from kit.exe and waits for the “app started” line.

The problem is that my agent does not get informed because a c++ app uses a buffer for stout and only when this buffer is full its content is written to the console stream. The result is, that my agent cannot read the output until the buffer is full.

Would it be possible to flush the buffer every time a message is written to the console? Or even after the “app started” line?

Another solution would be an event that is raised when the startup phase is completed, that my kit extension could fetch. In this case my extension could inform the agent about the completion of the startup phase… if this would be possible could someone share a snippet how to implement this in a kit extension?

Thanks

Carl

Hi Carl, thanks for sharing your efforts and challenge here…I will check with the development team on it.

By the way, will you be virtually attending SIGGRAPH 2021? You can use code NVIDIA21 for a free basic pass. In addition to hosting some great sessions, we will also convene our first Omniverse User Group during the event (it’s free and SIGGRAPH registration is not required)…it would be an honor to have you there with us!

Cheers,
Edmar

he / him | LinkedIn | Discord ID: Prof E#2041
Omniverse: “A New Era of Collaboration and Simulation” (video)
As seen in VentureBeat | Physics Showcase

Omniverse Resources:
Open Beta | Documentation | Tech Requirements | Videos | Roadmap | Twitter | Discord | Twitch

PLEASE NOTE: If you are reporting a bug/issue, please provide OS, GPU, GPU Driver, the version of the app, and full log file (if applicable). For crashes, please zip and provide a link to your logs → C:\Users\ [YOUR NAME] \ .nvidia-omniverse\logs

Hi Edmar,

thank you for the invitation, will try to attend.

In the meantime I had a deeper look at the docs and found omni.kit.app. StdOutInterceptor… would it be possible to intercept the console output here and call sys.stdout.flush after each message? (Do not have a pc at the moment to test this)…

If this would be a possible workaround… could some share a quick sample how to use StdOutInterceptor (my python skills are very limited… I’ve used c# and c++ for the last 25 years 😁)

Thanks

Carl

Hi Edmar,

you can close this… there is still something “strange” with the stream output, but I`ve found a way that worked for me…

flushStandardStreamOutput = true
outputStreamLevel = “Info”

…with this settings I can grab the “app started” message out of the console output stream