This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add API to logging package to allow intercooperation.
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: dmw, vinay.sajip
Priority: normal Keywords: patch

Created on 2004-09-21 22:07 by dmw, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
__init__.py-getLoggerClass.diff dmw, 2004-09-21 22:07 __init__.py-getLoggerClass.diff
liblogging.tex-getLoggerClass.diff dmw, 2004-09-21 22:08 liblogging.tex-getLoggerClass.diff
__init__.py-loggerClass.diff dmw, 2004-09-21 22:08 __init__.py-loggerClass.diff
liblogging.tex-loggerClass.diff dmw, 2004-09-21 22:11 liblogging.tex-loggerClass.diff
Messages (2)
msg46924 - (view) Author: Dave Wilson (dmw) Date: 2004-09-21 22:07
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.
msg46925 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2004-09-22 13:40
Logged In: YES 
user_id=308438

getLogger() version checked into CVS.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40940
2004-09-21 22:07:32dmwcreate