setuptools docs mention "distutils.log" ?
Folks: The setuptools page suggests that authors of revision control plugins can use "distutils.log.warn", but my version of distutils has no such name "log". http://docs.python.org/dist/module-distutils.log.html Regards, Zooko
At 09:34 PM 12/19/2007 -0700, zooko wrote:
Folks:
The setuptools page suggests that authors of revision control plugins can use "distutils.log.warn", but my version of distutils has no such name "log".
What version of distutils is that? Python 2.3, 2.4, and 2.5 (the only supported versions at this time) all include a distutils.log module.
On Dec 20, 2007, at 9:55 AM, Phillip J. Eby wrote:
At 09:34 PM 12/19/2007 -0700, zooko wrote:
Folks:
The setuptools page suggests that authors of revision control plugins can use "distutils.log.warn", but my version of distutils has no such name "log".
What version of distutils is that? Python 2.3, 2.4, and 2.5 (the only supported versions at this time) all include a distutils.log module.
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import distutils distutils.log Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'log
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 zooko wrote:
On Dec 20, 2007, at 9:55 AM, Phillip J. Eby wrote:
At 09:34 PM 12/19/2007 -0700, zooko wrote:
Folks:
The setuptools page suggests that authors of revision control plugins can use "distutils.log.warn", but my version of distutils has no such name "log". What version of distutils is that? Python 2.3, 2.4, and 2.5 (the only supported versions at this time) all include a distutils.log module.
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import distutils distutils.log Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'log
Try 'import distutils.log'. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHar2h+gerLs4ltQ4RAoSdAKCT4np27eEw9gzoYvsMCdcq0QBjuQCfbyH5 2ib4qRFkjn8MFTbemr5CUvE= =5ifs -----END PGP SIGNATURE-----
On Dec 20, 2007, at 12:08 PM, Tres Seaver wrote:
Try 'import distutils.log'.
Thank you. That works. However, since the current python docs warn that distutils.log is deprecated [1], I'm currently using "logging" instead. Is there any reason not to do that? Thanks, Zooko [1] http://docs.python.org/dist/module-distutils.log.html
At 10:35 AM 12/20/2007 -0700, zooko wrote:
On Dec 20, 2007, at 9:55 AM, Phillip J. Eby wrote:
At 09:34 PM 12/19/2007 -0700, zooko wrote:
Folks:
The setuptools page suggests that authors of revision control plugins can use "distutils.log.warn", but my version of distutils has no such name "log".
What version of distutils is that? Python 2.3, 2.4, and 2.5 (the only supported versions at this time) all include a distutils.log module.
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import distutils distutils.log Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'log
distutils.log isn't an object in the distutils module, it's a module in the distutils package. Use "import distutils.log" or "from distutils import log".
At 12:34 PM 12/20/2007 -0700, zooko wrote:
On Dec 20, 2007, at 12:08 PM, Tres Seaver wrote:
Try 'import distutils.log'.
Thank you. That works.
However, since the current python docs warn that distutils.log is deprecated [1], I'm currently using "logging" instead. Is there any reason not to do that?
Yes. First, that deprecation is unlikely to have any effect before Python 3.0, and second, using "logging" directly will prevent the distutils or setuptools from controlling the verbosity level of your output. In other words you will break the -q/-v options specified on the command line by the user.
participants (3)
-
Phillip J. Eby
-
Tres Seaver
-
zooko