Re: [Twisted-Python] Modifying the logstring

2010-12-07 Thread Einar S . Idsø
To continue my monologue: For future reference, it is worth noting that the code previously posted will not work for reconnecting clients since only the first connection receives the modified logPrefix method. A better approach is to bind logPrefix() in onClientConnected() to ensure it is bound for

Re: [Twisted-Python] Modifying the logstring

2010-12-06 Thread Einar S . Idsø
I was able to modify the logstring for the TCP query by following a similar approach to what I did to the UDP logger: def logPrefix(self): return self.connection.transport.protocol.__class__.__name__ + ", " + str(self.id) def startClient(self): self.f = self.factory(self,

[Twisted-Python] Modifying the logstring

2010-12-06 Thread Einar S . Idsø
Hi, I have an application which logs activity on a number of servers by two methods: 1. TCP-based queries (app is client) 2. UDP-based logging (app is server) Each server that is being logged is represented by an instance of a server class. TCP-queries are performed by each instance at set interv