summaryrefslogtreecommitdiff
path: root/Mailman/Logging/Syslog.py
diff options
context:
space:
mode:
authorbwarsaw2001-07-06 05:35:39 +0000
committerbwarsaw2001-07-06 05:35:39 +0000
commitf7c58d6098c9a548339633360d92dc563d993ec2 (patch)
tree339dca1642132d9097c1954f93950a4143d6c1bd /Mailman/Logging/Syslog.py
parent984b30495341b5510db35b15a61df73229c8605f (diff)
downloadmailman-f7c58d6098c9a548339633360d92dc563d993ec2.tar.gz
mailman-f7c58d6098c9a548339633360d92dc563d993ec2.tar.zst
mailman-f7c58d6098c9a548339633360d92dc563d993ec2.zip
Diffstat (limited to 'Mailman/Logging/Syslog.py')
-rw-r--r--Mailman/Logging/Syslog.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Mailman/Logging/Syslog.py b/Mailman/Logging/Syslog.py
index 2f740ff14..1dc41fc3c 100644
--- a/Mailman/Logging/Syslog.py
+++ b/Mailman/Logging/Syslog.py
@@ -36,7 +36,14 @@ class _Syslog:
def __del__(self):
self.close()
- def LogMsg(self, kind, msg, *args, **kws):
+ def write(self, kind, msg, *args, **kws):
+ self.write_ex(kind, msg, args, kws)
+
+ # We need this because SMTPDirect tries to pass in a special dict-like
+ # object, which is not a concrete dictionary. This is not allowed by
+ # Python's extended call syntax. :(
+ def write_ex(self, kind, msg, args=None, kws=None):
+ origmsg = msg
logf = self._logfiles.get(kind)
if not logf:
logf = self._logfiles[kind] = StampedLogger(kind)
@@ -47,11 +54,11 @@ class _Syslog:
msg %= kws
# It's really bad if exceptions in the syslogger cause other crashes
except Exception, e:
- msg = 'Bad format "%s": %s' % (msg, e)
+ msg = 'Bad format "%s": %s: %s' % (origmsg, repr(e), e)
logf.write(msg + '\n')
# For the ultimate in convenience
- __call__ = LogMsg
+ __call__ = write
def close(self):
for kind, logger in self._logfiles.items():