[Twisted-Python] Names DNS Client too chatty
Glyph Lefkowitz
glyph at twistedmatrix.com
Sun Jan 23 18:39:18 MST 2011
On Jan 23, 2011, at 7:11 PM, Jarosław Fedewicz wrote:
> My 2 cents to this is that responsiveness and performance of an application has turned out to be severely impacted even by console output, disk output of the same data being actually faster. Various tests have consistently shown that being 'distracted' for synchronous write() actually costs noticeable amounts of time.
Yes, logging in Twisted is a bit of a mess.
Almost all of these chatty little messages should not be logged to disk. If they're logged at all, they should be logged as purely structured data for observers to analyze later, not as text messages to go on a log file.
Something like this, maybe:
log.msg(interface=INameResolutionLogEvent, name=domain, recordType=type)
This will allow log observers to listen for events with event['interface'] == INameResolutionLogEvent, but won't trigger a synchronous write().
One of my dream features for Twisted's logging system is to get ring-buffer logging, like Foolscap has - <http://foolscap.lothar.com/docs/logging.html>. Also, to log a lot less text and a lot more structured stuff that can be examined later without big piles of regular expressions. I'd be happy to describe this in more detail if anyone would like to try to make systematic improvements to our logging subsystem or Twisted's internal use of it :).
In the meanwhile, I think it would be OK to just remove these messages entirely.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20110123/9091ae6d/attachment.html>
More information about the Twisted-Python
mailing list