Re: [Python-Dev] Redirecting warnings.showwarning to logging

2008-11-22 Thread Brett Cannon
On Sat, Nov 22, 2008 at 17:53, Vinay Sajip <[EMAIL PROTECTED]> wrote: > Sidnei da Silva enfoldsystems.com> writes: > >> I do have one suggestion for improvement: instead of requiring the >> person to do this monkey patching, add a new 'log' action to the >> warnings filter as described by PEP 230

Re: [Python-Dev] Redirecting warnings.showwarning to logging

2008-11-22 Thread Vinay Sajip
Sidnei da Silva enfoldsystems.com> writes: > I do have one suggestion for improvement: instead of requiring the > person to do this monkey patching, add a new 'log' action to the > warnings filter as described by PEP 230 [1] (see: 'The Warnings > Filter' section). This way, changing the behavior

Re: [Python-Dev] Redirecting warnings.showwarning to logging

2008-11-22 Thread Scott David Daniels
Scott David Daniels wrote: > > Match the new warning protocol exactly: > def showwarning(message, category, filename, lineno, > file=None, line=None): > ... > If the line is not None, use it (which will happen if you pass it > along to showwarning). > If

Re: [Python-Dev] Redirecting warnings.showwarning to logging

2008-11-22 Thread Scott David Daniels
Vinay Sajip wrote: Brett Cannon has suggested [1] that the logging package should provide an implementation of warnings.showwarning which redirects to logging. Here are my first thoughts about how this might work: A new function, showwarning( message, category, filename, lineno[, file]) will be

Re: [Python-Dev] Redirecting warnings.showwarning to logging

2008-11-22 Thread Sidnei da Silva
On Sat, Nov 22, 2008 at 9:12 AM, Vinay Sajip <[EMAIL PROTECTED]> wrote: > Brett Cannon has suggested [1] that the logging package should provide an > implementation of warnings.showwarning which redirects to logging. Here are my > first thoughts about how this might work: > > A new function, showwa

Re: [Python-Dev] Redirecting warnings.showwarning to logging

2008-11-22 Thread Brett Cannon
On Sat, Nov 22, 2008 at 03:12, Vinay Sajip <[EMAIL PROTECTED]> wrote: > Brett Cannon has suggested [1] that the logging package should provide an > implementation of warnings.showwarning which redirects to logging. Here are my > first thoughts about how this might work: > > A new function, showwarn

[Python-Dev] Redirecting warnings.showwarning to logging

2008-11-22 Thread Vinay Sajip
Brett Cannon has suggested [1] that the logging package should provide an implementation of warnings.showwarning which redirects to logging. Here are my first thoughts about how this might work: A new function, showwarning( message, category, filename, lineno[, file]) will be added to the logging