Re: [Twisted-Python] Logging and SpawnProcess

2020-12-30 Thread Robert DiFalco
This was very helpful thanks! On Wed, Dec 30, 2020 at 10:08 PM Glyph wrote: > One minor point, if this is within your power: don't marshal data over > stdout; sometimes libraries scribble on it. Open an arbitrary additional > file descriptor - say, 7 - and put your marshalled data there. > > De

Re: [Twisted-Python] Logging and SpawnProcess

2020-12-30 Thread Glyph
One minor point, if this is within your power: don't marshal data over stdout; sometimes libraries scribble on it. Open an arbitrary additional file descriptor - say, 7 - and put your marshalled data there. Definitely never use stderr for marshaling anything but lines of text - you're not gonn

Re: [Twisted-Python] Logging and SpawnProcess

2020-12-30 Thread Tom Most
I'm not entirely following the question (is the log output intermixed with other data on stdout?) but I think that you might find the implementation of twisted.internet.endpoints.ProcessEndpoint a useful example. It relays stderr to the logging stream: https://github.com/twisted/twisted/blob/c8

[Twisted-Python] Logging and SpawnProcess

2020-12-30 Thread Robert DiFalco
Can anyone point me to some sample code for handling logging with SpawnProcess? Right now I'm using an EchoProtocol that takes stdout and resends it to the log. But it's kludgy because some sub-processes use stdin/stderr for marshaling data. What I'd most like to do is separate data transfer from l