A quieter paramiko?

Andrew Bennetts andrew.bennetts at canonical.com
Mon Jan 4 01:45:41 GMT 2010


Juanma Barranquero wrote:
> Another question. Is there a way to make paramiko be somewhat quieter?
> In the following:
> 
>   C:\emacs\trunk> bzr up
>   Connected (version 2.0, client OpenSSH_5.1p1)
>   Authentication (publickey) successful!
>   Secsh channel 1 opened.
>   [chan 1] Opened sftp connection (server version 3)
>   Tree is up to date at revision 99249.
> 
> all but the last line are irrelevant unless an error happens.

My guess is that paramiko is emitting those via Python's logging module.  So
it's probably just a matter of installing an appropriate log handler...
hopefully those messages from paramiko are all DEBUG or INFO level.  We'd want
to take a little care to delay installing that logging handler until paramiko is
imported for first use, probably (logging is a relatively large and slow module,
and we don't want to pay the price for importing and initialising it if it isn't
going to be used).  To be pedantically correct we should probably not do that by
default if not run from the 'bzr' executable, but I don't think that matters
very much...

Patches welcome!  By a happy coincidence I'm the Patch Pilot this week, so I'll
be even happier than usual to offer guidance if anyone wants to work on this :)

-Andrew.




More information about the bazaar mailing list