From e8748645a374d14f066cab3aefb82bf85c3b73bc Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sun, 6 Jul 2008 15:58:42 -0700 Subject: [PATCH] [project @ robey@lag.net-20080706225842-25rg9uk9ksyxxbyf] fix convoluted logging method --- paramiko/sftp.py | 4 ++-- paramiko/sftp_client.py | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/paramiko/sftp.py b/paramiko/sftp.py index dc8e99a..2296d85 100644 --- a/paramiko/sftp.py +++ b/paramiko/sftp.py @@ -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: diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 5791d95..338d19b 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -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): """