summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorklm1998-08-03 22:08:13 +0000
committerklm1998-08-03 22:08:13 +0000
commit7cfb94cea52bc813fcc0734fb421e7ba47113cc6 (patch)
treece261014a046c64a5231ff9f63b94d352786f68a
parentacd94b94e7df83a5a7c774ac325937d75be822be (diff)
downloadmailman-7cfb94cea52bc813fcc0734fb421e7ba47113cc6.tar.gz
mailman-7cfb94cea52bc813fcc0734fb421e7ba47113cc6.tar.zst
mailman-7cfb94cea52bc813fcc0734fb421e7ba47113cc6.zip
-rw-r--r--Mailman/Logging/Logger.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/Mailman/Logging/Logger.py b/Mailman/Logging/Logger.py
index 1a6f36454..6dd6d9708 100644
--- a/Mailman/Logging/Logger.py
+++ b/Mailman/Logging/Logger.py
@@ -24,12 +24,14 @@ from Mailman.Logging.Utils import _logexc
class Logger:
def __init__(self, category, nofail=1, immediate=0):
- """Nofail (by default) says to fallback to sys.__stderr__ if write
- fails to category file. A message is emitted, but the IOError is
- caught. Set nofail=0 if you want to handle the error in your code,
- instead. immediate=1 says to create the log file immediately,
- otherwise it's created when first needed.
- """
+ """Nofail says to fallback to sys.__stderr__ if write fails to
+ category file - a complaint message is emitted, but no exception is
+ raised. Set nofail=0 if you want to handle the error in your code,
+ instead.
+
+ immediate=1 says to create the log file on instantiation.
+ Otherwise, the file is created only when there are writes pending."""
+
self.__filename = os.path.join(Mailman.mm_cfg.LOG_DIR, category)
self.__fp = None
self.__nofail = nofail
@@ -40,7 +42,7 @@ class Logger:
self.close()
def __repr__(self):
- return '<Logger to file: %s>' % self.__filename
+ return '<%s to %s>' % (self.__class__.__name__, `self.__filename`)
def __get_f(self):
if self.__fp: