[Code-review] review: Gadget debug branch

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Aug 11 14:39:33 EDT 2008


Le lundi 11 août 2008 à 14:12 +0100, Dafydd Harries a écrit :
> 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.


Actually I do like the [SEND]/[RECV] markups and having each stanza well
delimited. More blank lines in log make them lot easier to read (as in
loudmouth).


	G.




More information about the Code-review mailing list