Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Commit

Permalink
Don't relog child output
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfredo Sanchez committed Jan 4, 2014
1 parent ef66b48 commit 9d026af
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions twext/application/masterchild.py
Expand Up @@ -488,7 +488,8 @@ class ChildProcessProtocol(ProcessProtocol, object):
Process protocol for child processes. Process protocol for child processes.
""" """


log = Logger() # FIXME: deserialize log events from child
# log = Logger()




def __init__(self, service, inheritedSocket): def __init__(self, service, inheritedSocket):
Expand All @@ -497,12 +498,14 @@ def __init__(self, service, inheritedSocket):




def outReceived(self, data): def outReceived(self, data):
self.log.info(u"{data}", data=data) # self.log.info(u"{data}", data=data)
sys.stdout.write(data)




def errReceived(self, data): def errReceived(self, data):
super(ChildProcessProtocol, self).errReceived(data) super(ChildProcessProtocol, self).errReceived(data)
self.log.error(u"{data}", data=data) # self.log.error(u"{data}", data=data)
sys.stderr.write(data)




def processExited(self, reason): def processExited(self, reason):
Expand Down Expand Up @@ -632,6 +635,18 @@ def createTransport(self, socket, peer, data, protocol):




class ReportingProtocolWrapper(ProtocolWrapper, object): class ReportingProtocolWrapper(ProtocolWrapper, object):
# def __init__(self, *args, **kwargs):
# try:
# raise RuntimeError()
# except RuntimeError:
# from twisted.python.failure import Failure
# f = Failure()
# f.printTraceback()
# return super(ReportingProtocolWrapper, self).__init__(
# *args, **kwargs
# )


def connectionLost(self, reason): def connectionLost(self, reason):
# self.factory.protocolDidLoseConnection(self) # self.factory.protocolDidLoseConnection(self)
self.factory.inheritedPort.reportStatus("-") self.factory.inheritedPort.reportStatus("-")
Expand Down

0 comments on commit 9d026af

Please sign in to comment.