distutils.log creates its own PEP 282-like logger
class, which is fine from the distutils point of view,
but not exactly brilliant if you want to intercept the
calls using the logging facilities that have been in
python since 2.3.
Recommended fix:
If, in fact, distutils.log has to be kept compatible
with 2.1 as is claimed in the source file then
something along the lines of:
try:
import logging
_global_log = logging.getLogger('distutils')
except ImportError:
#insert current Log class definition here
_global_log = Log()
Also, changing the values for DEBUG, INFO, WARN, ERROR and
FATAL to be the same as the ones in logging.py is
probably a good idea.
The distutils logger should have its own formatter that
prints out lines as the thing currently does, but this
formatter should be set within the code for setup()
rather than in the log module.
|