fix convoluted logging method
This commit is contained in:
parent
5989710968
commit
e8748645a3
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue