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))
|
self._send_packet(CMD_VERSION, str(msg))
|
||||||
return version
|
return version
|
||||||
|
|
||||||
def _log(self, level, msg):
|
def _log(self, level, msg, *args):
|
||||||
self.logger.log(level, msg)
|
self.logger.log(level, msg, *args)
|
||||||
|
|
||||||
def _write_all(self, out):
|
def _write_all(self, out):
|
||||||
while len(out) > 0:
|
while len(out) > 0:
|
||||||
|
|
|
@ -105,12 +105,8 @@ class SFTPClient (BaseSFTP):
|
||||||
return cls(chan)
|
return cls(chan)
|
||||||
from_transport = classmethod(from_transport)
|
from_transport = classmethod(from_transport)
|
||||||
|
|
||||||
def _log(self, level, msg):
|
def _log(self, level, msg, *args):
|
||||||
if issubclass(type(msg), list):
|
super(SFTPClient, self)._log(level, "[chan %s] " + msg, *([ self.sock.get_name() ] + list(args)))
|
||||||
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 close(self):
|
def close(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue