[Twisted-Python] Logging and SpawnProcess

Tom Most twm at freecog.net
Wed Dec 30 22:12:00 MST 2020


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/c8064075a207af1fc9ce19d8f885a986bc5ab00c/src/twisted/internet/endpoints.py#L336-L479

---Tom

On Wed, Dec 30, 2020, at 11:38 AM, Robert DiFalco wrote:
> 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 log output in a clean way. 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20201230/60dcc9c4/attachment.htm>


More information about the Twisted-Python mailing list