fix convoluted logging method
This commit is contained in:
Robey Pointer 2008-07-06 15:58:42 -07:00
parent 5989710968
commit e8748645a3
2 changed files with 4 additions and 8 deletions

View File

@ -128,8 +128,8 @@ class BaseSFTP (object):
self._send_packet(CMD_VERSION, str(msg))
return version
def _log(self, level, msg):
self.logger.log(level, msg)
def _log(self, level, msg, *args):
self.logger.log(level, msg, *args)
def _write_all(self, out):
while len(out) > 0:

View File

@ -105,12 +105,8 @@ class SFTPClient (BaseSFTP):
return cls(chan)
from_transport = classmethod(from_transport)
def _log(self, level, msg):
if issubclass(type(msg), list):
for m in msg:
super(SFTPClient, self)._log(level, "[chan " + self.sock.get_name() + "] " + m)
else:
super(SFTPClient, self)._log(level, "[chan " + self.sock.get_name() + "] " + msg)
def _log(self, level, msg, *args):
super(SFTPClient, self)._log(level, "[chan %s] " + msg, *([ self.sock.get_name() ] + list(args)))
def close(self):
"""