From 52cf3f74d00704b9fc4e71b24eec67f4ddc11698 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Sat, 19 Oct 2002 20:58:14 +0000 Subject: __writelog(): It turns out to be really helpful to print the stack trace when we do logging. --- Mailman/LockFile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Mailman/LockFile.py') diff --git a/Mailman/LockFile.py b/Mailman/LockFile.py index 9f9f44056..796a81eb7 100644 --- a/Mailman/LockFile.py +++ b/Mailman/LockFile.py @@ -63,6 +63,7 @@ import socket import time import errno import random +import traceback from stat import ST_NLINK, ST_MTIME # Units are floating-point seconds. @@ -403,7 +404,9 @@ class LockFile: def __writelog(self, msg): if self.__withlogging: - _get_logfile().write('%s %s\n' % (self.__logprefix, msg)) + logf = _get_logfile() + logf.write('%s %s\n' % (self.__logprefix, msg)) + traceback.print_stack(file=logf) def __write(self): # Make sure it's group writable -- cgit v1.2.3-70-g09d2