| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
traces of our crufty old Syslog. Most of this work was purely mechanical,
except for:
1) Initializing the loggers. For this, there's a new module
Mailman/loginit.py (yes all modules from now on will use PEP 8
names). We can't call this 'logging.py' because that will
interfere with importing the stdlib module of the same name (can
you say Python 2.5 and absolute imports?).
If you want to write log messages both to the log file and to
stderr, pass True to loginit.initialize(). This will turn on
propagation of log messages to the parent 'mailman' logger, which
is set up to print to stderr. This is how bin/qrunner works when
not running as a subprocess of mailmanctl.
2) The driver script. I had to untwist the StampedLogger stuff and
implement differently printing exceptions and such to log/error
because standard logging objects don't have a write() method. So
we write to a cStringIO and then pass that to the logger.
3) SMTPDirect.py because of the configurability of the log messages.
This required changing SafeDict into a dict subclass (which is
better than using UserDicts anyway -- yay Python 2.3!). It's
probably still possible to flummox things up if you change the
name of the loggers in the SMTP_LOG_* variables in mm_cfg.py.
However, the worst you can do is cause output to go to stderr and
not go to a log file.
Note too that all entry points into the Mailman system must call
Mailman.loginit.initialize() or the log output will go to stderr
(which may occasionally be what you want). Currently all CGIs and
qrunners should be working properly.
I wish I could have tested all code paths that touch the logger, but
that's infeasible. I have tested this, but it's possible that there
were some mistakes in the translation.
- Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class
instance any more.
- True/False code cleanup, PEP 8 import restructuring, whitespace
normalization, and copyright year updates, as appropriate.
|
| |
|
|
|
| |
the trunk. This serves also to test write permission to the svn
repository, and tests email notifications.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Jr, after much checking and rechecking (and some massaging) by me. Checking
in now before I fall asleep and forget what all this was for.
This patch adds the ability to 'make DESTDIR=/some/dir/tree install' that
doesn't influence the paths stored in e.g. Defaults.py at all, which is of
good use for various package managers. It is not all that package managers
must do, however! Running make install with DESTDIR set means bin/update is
never run, and mm_cfg.py is always written; package managers should make
sure the appropriate post-installation is done, and that mm_cfg.py is
treated as a config file.
This patch inadvertently fixes some bogus whitespace: 8-spaces where
surrounding code used tabs. The difference was harmless because the 8-spaces
were used inside shell-continued-oneliners, but it is confusing and could
lead to future harm. I'm too tired to make those two or three changes in a
separate checkin, sorry.
This patch also assumes the various packages that are installed using
distutils do not record (or rather, use) their installation paths anywhere,
but this seems to hold true at least for the moment.
Also, I've done so many slow cvs diff's, I'm wondering when we'll switch to
Subversion. Unfortunately, I've also done so many 'cvs diff -c > file; patch
-p0 -R < file's to switch back and forth between patches and change sets,
I'm wondering when we'll switch to Aegis as well. :-P
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
stdout, so much as tee it to stderr, so I've changed the name of the
argument and implemented this as a tee to stderr.
I don't think this breaks any code, but I'm not 100% sure yet.
Also, whitespace normalization and pychecker fixes.
|
| |
|
|
|
|
|
|
|
|
| |
for the log file (defaults to iso-8859-1, which works for xterms and
xemacs buffers, although we may have to change this to us-ascii for
release). We try to open the log file using the codecs module so
output will be encoded by the proper stream writer.
I'm not 100% sure about these changes, but they seem right and work
for me.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
write(): Just call new function write_ex(), passing arguments through.
write_ex(): Use explicit arguments to pass in the args tuple and kws
dictionary. This is because Python requires **kws in extended calls
to be concrete dictionary objects, not generic mapping objects.
SMTPDirect wants to pass in an instance of (subclassed) UserDict, so
it calls write_ex() directly.
Also, stash the msg argument in local variable origmsg, which is used
if we get an exception during string interpolation.
|
| | |
|
| |
|
|
|
|
| |
nicer and more robust. String interpolation is now done here instead
of at callee site, so exceptions like TypeError and ValueError can be
caught and dealt with better.
|
| | |
|
| |
|
|
| |
re-opened at the next attempted write.
|
| |
|
|
| |
be instantiated.
|
| |
|
|
|
|
| |
Syslog.py: New global logging class which replaces the
MailList.LogMsg() interface. This module also creates a global
instance which is callable and should be used for convenience.
|
| |
|
|
| |
from the function argument.
|
| |
|
|
|
|
|
| |
Utils.reraise() hack.
Also, use import statements which are more consistent with the rest of
Mailman.
|
| | |
|
| |
|
|
| |
if the logger doesn't have a reprime method.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
shouldn't be necessary.
|
| |
|
|
| |
argument to StampedLogger().
|
| |
|
|
|
|
|
|
|
|
|
|
| |
propagate version string changes to the public (you have to
autoreconf, then reconfigure and reinstall).
Now, VERSION is set directory in Defaults.py.in and the Release.py
script updates that file directly. Now we just need to run
./config.status and do a re-install. I hope this will make things
easier.
I'm also bumping the version to 1.0b8, so I can do a release tomorrow.
|
| | |
|
| |
|
|
|
|
| |
doesn't have the attribute sys.__stdout__; although this is placed
into the sys module by the driver, I think there are non-CGI paths to
this code.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
hardcoded "Logger", so derived classes (eg, StampedLogger) identify
themselves correctly.
.__init__(): Clarified function docstring a bit.
|
| |
|
|
| |
which is passed through to the Logger.__init__().
|
| |
|
|
| |
XXX: This class is no longer used by the driver script.
|
| |
|
|
|
|
|
|
|
|
|
| |
Logger.__init__(): New default argument `immediate' says to open the
log file immediately upon creation (so we learn of errors early).
Otherwise the log file is opened when first needed.
Logger.__get_f(): Re-raise the exception using Python 1.5 semantics;
can't guarantee everyone has Python 1.5.1. Also if nofail, then set
the file pointer to be sys.__stderr__ so at least the exceptions will
get logged to the Web server log file.
|
| |
|
|
| |
doesn't get name mangled.
|
| |
|
|
|
|
| |
current directory, the full path of the package must be given.
Strictly speaking, the package path isn't necessary since it is
guaranteed to find the right Utils.
|
| | |
|
| |
|
|
| |
sys.stderr (and tee it to sys.stdout, also).
|
|
|
StampedLogger is carried over from before, with some changes.
Logger used to be in Mailman.Utils
MultiLogger is new, it is used to log identical message to a list of
loggers supporting the write interface of file-like objects (e.g. a
Logger or sys.__stdout__).
|