[Patches] [ python-Patches-1032206 ] Add API to logging package to allow intercooperation.

SourceForge.net noreply at sourceforge.net
Wed Sep 22 15:40:11 CEST 2004


Patches item #1032206, was opened at 2004-09-21 22:07
Message generated for change (Comment added) made by vsajip
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1032206&group_id=5470

Category: Library (Lib)
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Dave Wilson (dmw)
>Assigned to: Vinay Sajip (vsajip)
Summary: Add API to logging package to allow intercooperation.

Initial Comment:
This set of patches implements two simple ways in which
the logging package could be extended to allow more
than one body of code to customize the base Logger class.

The first patch (and doc patch) implements a
"getLoggerClass()" function symmentrical to the
existing "setLoggerClass()" function.

The second patch instead renames the internal
"_loggerClass" variable to "loggerClass", leaving the
old setLoggerClass() function for compatibility.


The problem with the logging module at present is that
if I wish to define extra functionality in the Logger
class for use with my application or package, and
another package that I make use of does the same, then
one set of Logger class customisations will be lost.

Using the above patches, the standard way to extend
Logger would go from:

   class MyLogger(logging.Logger):
      ...

to:

   class MyLogger(logging.getLoggerClass()):
      ...

or alternatively for the second patch:

   class MyLogger(logging.loggerClass):
      ...


Thanks,


David.

----------------------------------------------------------------------

>Comment By: Vinay Sajip (vsajip)
Date: 2004-09-22 13:40

Message:
Logged In: YES 
user_id=308438

getLogger() version checked into CVS.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1032206&group_id=5470


More information about the Patches mailing list