[Code-review] review: Gadget debug branch
Dafydd Harries
dafydd.harries at collabora.co.uk
Mon Aug 11 09:12:28 EDT 2008
This seems like a good idea. A slightly different approach is to use prefixes,
something like:
def log_send(msg):
log.msg(''.join('>>> ' + line for line in msg.toXml.splitlines()))
def log_recv(msg):
log.msg(''.join('<<< ' + line for line in msg.toXml.splitlines()))
There's code that does this in here:
http://git.collabora.co.uk/?p=user/daf/mingle.git;a=summary
It actually goes a bit further and applies colours to messages according to
type, but this doesn't necessarily interact very well with Twisted logging.
I'm not particularly attached to either style.
--
Dafydd
More information about the Code-review
mailing list