Exception report library

Robert Brewer fumanchu at amor.org
Fri Jan 7 22:37:07 CET 2005


Ian Bicking wrote:
> I've been using one of several systems to catch unexpected exceptions 
> and log them (e.g., write to a file, display on web page, email me, 
> etc).  But many are built into a particular system, or have an 
> interesting but incomplete set of features.  E.g., many web 
> frameworks have exception reporters (and the stdlib includes cgitb),
> but I want to handle non-web exceptions in the same way as exceptions
> from web requests, and that's not generally easy.
...
> I feel like there must be something out there, since every Python 
> programmer has to deal with this sort of thing to some degree...?

I feel that way, too, but haven't found it. I broke my webapp framework
out of my ORM late last year, and quickly realized how small the core
framework really is (22k, versus 250k for the web bits). Features like
the logging handler could be provided as separate modules, rather than
built into the Application object, and I've been meaning to get around
to that. If we could put our many heads together, I think this would be
doable for the stdlib.

Here are the pieces of the framework, by the way, which might also
benefit from some standardization (I was thinking about them all at
once):

   1. Thread-safe application state
   2. Logging (+ exception handling)
   3. Configuration data (reading from various sources)
   4. Registry of Workers for getting things done on a schedule,
possibly recurring
   5. Registry of startup/shutdown functions
   6. Registry of active user interfaces

I think the first three are all good candidates for a standard. If we
had a standard, thread-safe Application object, the rest could be
registerable plugins for that. You'd basically register callbacks for
app.startup and .shutdown methods to iterate over.


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-list mailing list