Aviv Palivoda added the comment:

I see the backwards compatibility issue. I have two suggestion's how to improve 
the code without breaking backwards compatibility:

1. Add a new Handler class named SafeHandler that will implement handle in the 
way suggested in the previous patch. All the stdlib handler's will inherit from 
SafeHandler and in the documentation we will suggest using this handler. I am 
adding a patch (logging-SafeGandle.patch) with this suggestion.

2. Add new module-level attribute handleException that will deprecate 
raiseException. When raiseException is set or when handleException is at the 
default value the current behavior will remain. You can set handleException to 
the following values:
   a. print - print exception to stderr
   b. propagate - propagate exception
   c. ignore - swallow the exception

The current behavior has a few inconsistencies with raiseException. For example 
when raiseException is True the handleError method don't propagate the 
excpetion as will be expected. This patch will solve this problem in addition 
to the one named in the previous message. I am adding a patch with this 
suggested behavior (logging-handleException). 

Both patch's are in initial steps and are just to show more clearly what i am 
suggesting. There are currently no tests or documentation for either patch. 
Both patch's pass all logging test's without any changes to prove the backwards 
compatibility.

----------
Added file: http://bugs.python.org/file42425/logging-SafeHandle.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26705>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to