[merge][rfc] log+ transport decorator

Robert Collins robertc at robertcollins.net
Wed Oct 17 09:02:57 BST 2007


On Wed, 2007-10-17 at 15:42 +1000, Martin Pool wrote:
> 
> +from bzrlib.transport.trace import (
> +    DecoratorServer,
> +    TransportTraceDecorator,
> +    ) 

This is strange.

I think it would be nice to consolidate the trace+ and log+
implementations more - while there are differences, they are not enough
to have two completely different approaches in use, and indeed
discovering we need to decorate a new method should be something that we
fix for both log+ and trace+ at the same time.

A slight variation on this is to note that we either need logging, or
memory accumulation - I think something like a
CapturingTransportDecorator, that takes a _gather() callback in its
constructor would be nicer - then the registered factory, like the
http:// factory, can decide at runtime what to supply for the gather
function. For instance, you can key it off the prefix - trace+ vs log+,
or look for global variables or other such things.

I agree with you that the 'gather for tests' and 'gather for humans'
functions are separate and shouldn't been needlessly conflated.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071017/7a3bfce2/attachment.pgp 


More information about the bazaar mailing list