[merge][rfc] log+ transport decorator

Martin Pool mbp at sourcefrog.net
Wed Oct 17 09:08:09 BST 2007


On 10/17/07, Robert Collins <robertc at robertcollins.net> wrote:
> On Wed, 2007-10-17 at 15:42 +1000, Martin Pool wrote:
> >
> > +from bzrlib.transport.trace import (
> > +    DecoratorServer,
> > +    TransportTraceDecorator,
> > +    )
>
> This is strange.

I started out deriving from that.

> 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.

Now it's working for me I'm happy to combine them before merging -
probably taking more from the new implementation than the existing
one.  Do you have any comments on the way that's done?

-- 
Martin



More information about the bazaar mailing list