logging: warn() methods and function to be deprecated.

Mike C. Fletcher mcfletch at vrplumber.com
Wed Oct 26 12:20:06 EDT 2011


On 11-10-26 10:51 AM, Vinay Sajip wrote:
...
> auto-translation via 2to3 (because you generally are calling log.warn()
>> rather than logging.warning, but sometimes you are doing getattr( log,
>> log_level ) and then passing that method around a few times), and it
> That doesn't sound like a good usage pattern to me, especially as loggers have a
> log method which takes the logging level. There shouldn't be any need to pass a
> bound method around.
Bound methods also pull along to *which* log you are going to send the
message, but then I suppose you could just use the logging key as well
as a piece of data.  I'll withdraw the suggestion that it is not a
trivial thing to add to 2to3, though I'll leave the implementation to
someone else.

Have fun,
Mike

-- 
________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com




More information about the Python-list mailing list