[Python-Dev] Re: PEP 282 comments

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


Vinay Sajip wrote:
> 
> [Neal Norwitz]
> > 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.
> This violates the principle that logging should be "set and forget". Having
> the logger fail silently has, in past experience, caused fewer problems than
> having to handle errors from the logging system - yet another headache for
> the developer!

This is my point.  It will almost always be ignored...unless
the caller really needs to know the information.  The logger
will fail silently, only an object will be returned
(no exception thrown) and the caller can safely ignore it.

Neal