[Python-Dev] Re: PEP 282 comments

Trent Mick trentm@ActiveState.com
Wed, 20 Mar 2002 18:13:07 -0800


[Vinay Sajip wrote]
> > > def logException(self, level, exc_info, msg, *args)
> >
> > No need to pass in the exc_info if you are already specifying that an
> > exception is being logged via log*Exception*.

> Yes, except that you are assuming (I think) that logException would call
> sys.exc_info() to get the exception info.  what about if the exception info
> needs to come from somewhere else (e.g.  from a pickled message sent over
> the wire)? I haven't yet thought through all the issues about passing
> tracebacks etc. across sockets...

Touche, I haven't thought about that either and don't know if I am qualified
to determine if that is a common enough case. If it is *not* that common then
(forgetting the 'level'-issue for the moment) you have to admit that:

    try:
        ...
    except:
        log.exception("My britches are burning!")

sure is a log nicer than

    try:
        ...
    except:
        log.logException(sys.exc_info(), "My britches are burning!")


Trent

-- 
Trent Mick
TrentM@ActiveState.com