summaryrefslogtreecommitdiff
path: root/Mailman/Logging
Commit message (Collapse)AuthorAgeFilesLines
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-177-482/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Now that we've converted from CVS to Subversion, remove CVS cruft frombwarsaw2006-04-151-1/+0
| | | | | the trunk. This serves also to test write permission to the svn repository, and tests email notifications.
* Port cleaning changes forward from 2.1-maint branch.bwarsaw2005-12-302-7/+10
|
* Python 2.4 may fail to write 8bit (non-ascii) characters.tkikuchi2005-12-241-1/+6
|
* back porting from 2.1.6tkikuchi2005-08-281-5/+5
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-277-7/+7
|
* Update copyright yearsbwarsaw2003-03-111-1/+1
|
* SF patch #683906, add $DESTDIR to install target, by Ademar de Souza Reistwouters2003-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Donn Cave's patch #602087 to honor configure's --srcdir switch.bwarsaw2002-12-121-1/+1
|
* __get_f(): LookupError is built-in. Bug reported by Carson Gaspar.bwarsaw2002-11-111-1/+1
|
* LogStdErr(): I don't think we really wanted to tee the log output tobwarsaw2002-10-211-19/+21
| | | | | | | | | 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.
* Fixes for logging of non-ascii messages. We have a default encodingbwarsaw2002-09-171-1/+17
| | | | | | | | | | 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.
* Update copyright years.bwarsaw2002-03-167-7/+7
|
* LogMsg() -> write()bwarsaw2001-07-061-3/+10
| | | | | | | | | | | | | 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.
* write(): Compare to None with `is' not `=='.bwarsaw2001-06-271-3/+6
|
* LogMsg(): Extended function signature to make argument passing bothbwarsaw2001-06-271-3/+12
| | | | | | 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.
* Untabification.bwarsaw2001-06-021-26/+27
|
* close(): When the file object is closed, set __fp to None so it getsbwarsaw2001-06-021-1/+2
| | | | re-opened at the next attempted write.
* Rename Syslog class to _Syslog to indicate that it shouldn't normallybwarsaw2000-06-021-3/+4
| | | | be instantiated.
* Makefile.in: Install all .py filesbwarsaw2000-06-022-2/+53
| | | | | | 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.
* LogStdErr(): In the call to StampedLogger(), pass manual_reprime valuebwarsaw2000-06-011-1/+1
| | | | from the function argument.
* __get_f(): Since Python 1.5.2 is now required, we can get rid of thebwarsaw2000-04-031-4/+4
| | | | | | | Utils.reraise() hack. Also, use import statements which are more consistent with the rest of Mailman.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-216-5/+20
|
* reprime(): calls reprime on all sub-loggers, ignoring attribute errorsbwarsaw1999-12-251-0/+7
| | | | if the logger doesn't have a reprime method.
* Typobwarsaw1999-12-131-1/+1
|
* Slight change in formatbwarsaw1999-12-131-3/+3
|
* Always include the non-cached PID of the process doing the printing.bwarsaw1999-12-131-1/+2
|
* __get_f(): Open the log file in line buffered mode so flushesbwarsaw1999-12-131-1/+1
| | | | shouldn't be necessary.
* LogStdErr(): category was being ignored. Instead, use it as the firstbwarsaw1999-04-161-1/+1
| | | | argument to StampedLogger().
* VERSION is no longer set in configure because it's too hard tobwarsaw1999-01-151-2/+0
| | | | | | | | | | | | 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.
* __get_f(): Use Mailman.Utils.reraise()bwarsaw1998-12-291-5/+2
|
* LogStdErr(): small patch to ensure we get a stdout. Python 1.5bwarsaw1998-12-291-1/+5
| | | | | | 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.
* `make distclean' now removes stray .pyc files.bwarsaw1998-11-171-0/+1
|
* make finishbwarsaw1998-10-201-0/+2
|
* .__repr__(): Use the class name in the repr string, rather thanklm1998-08-031-7/+9
| | | | | | | hardcoded "Logger", so derived classes (eg, StampedLogger) identify themselves correctly. .__init__(): Clarified function docstring a bit.
* StampedLogger.__init__(): Added new default argument `immediate'bwarsaw1998-07-311-3/+6
| | | | which is passed through to the Logger.__init__().
* __logexc() => _logexc()bwarsaw1998-07-311-4/+4
| | | | XXX: This class is no longer used by the driver script.
* __logexc() => _logexc()bwarsaw1998-07-311-9/+16
| | | | | | | | | | | 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.
* __logexc(): Renamed to _logexc() -- single leading underscore -- so itbwarsaw1998-07-311-1/+2
| | | | doesn't get name mangled.
* Fixed package name in import of __logexc. If the module is not in thebwarsaw1998-07-231-1/+1
| | | | | | 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.
* Simplify the import, exploiting the fact that it's within the package.klm1998-07-232-2/+2
|
* LogStdErr(): New routine to simplify hooking up a StampedLogger withklm1998-07-231-0/+21
| | | | sys.stderr (and tee it to sys.stdout, also).
* Subpackage containing all logging classes.bwarsaw1998-07-027-0/+324
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__).