On Sun, Dec 13, 2009 at 10:01 PM, Moritz Beber
<moritz.be...@googlemail.com> wrote:

> I can add a handler of my choosing to the Transport.logger but then
> something strange happens: I get duplicate entries on stdout.
>
> I checked the list of handlers for Transport.logger and it contains only
> one handler. When I do not add a handler, the list is empty, but logging
> still occurs to stdout.
>

How are you going about adding the handler? I couldn't replicate this
from a quick test.


> So I poked around in the sources and saw that logging is done by the
> Transport.packetizer as well. Unfortunately, that class' logger is
> private so I couldn't check the available handlers there.
>

If you're new to python, nothing is really private. You should respect
the private pieces of the api by convention, but there's no reason you
can't inspect those pieces to debug your problem.


> Since I couldn't find anywhere in the initialisation order when creating
> a Transport instance that would add a handler to the packetizer I guess
> something default is being done when importing.
>

AFAIK, no handlers are added by default. This actually causes the
logging module to print a warning to stdout if it gets called, because
it always expects to have a handler present.


-jim

_______________________________________________
paramiko mailing list
paramiko@lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko

Reply via email to