[Python-Dev] Re: PEP 282 comments (original) (raw)

Neal Norwitz neal@metaslash.com
Thu, 21 Mar 2002 08:13:10 -0500


Vinay Sajip wrote:

There is a potential minefield here - if we are allowing any logging record to be sent by wire to a remote logger, then the "userinfo" needs to go too - and what if something in it can't be pickled? Given that it is really important that the logging system is silent except when explicitly asked to do something by a logging call, exceptions caught in the logging system are generally ignored by design. This means that pickling exceptions would not be raised, and I foresee difficulties for developers... The idea of allowing arbitrary objects into the LogRecord is very powerful and has much to commend it, but I think the pickling problem may need to be solved first.

You could have the logging methods return an int/bool, 1 if succesfully logged, 0 on failure. Let the caller decide what to do. You could even return a failure object or None. The failure object would contain (or be) the exception/problem.

Neal