[issue23151] _loggerClass is initialized twice

Vinay Sajip report at bugs.python.org
Fri Jan 2 17:46:06 CET 2015


Vinay Sajip added the comment:

The code in Manager.getLogger() allows an overriding logger class for that manager instance only - if it's not set (which is the default), it uses the module global _loggerClass. The lines

rv = (self.loggerClass or _loggerClass)(name)

indicate this.

The module global _loggerClass is initialized to None initially, simply so that it can be defined before being used in Manager (so really, for readability). Later, after Logger is defined, _loggerClass is set to Logger.

Is this causing some actual problem?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23151>
_______________________________________


More information about the Python-bugs-list mailing list