How to get error log of a disutils setup in Python?

最后都变了- 提交于 2019-12-03 12:34:25

Setting DISTUTILS_DEBUG=1 in the environment will cause debug logging.

distutils1 (first version) uses too a internal version of logging (a bit hardcoded, it is not using the standard logging module). I think that it is possible to set the verbosity level coding something like:

import distutils.log
distutils.log.set_verbosity(-1) # Disable logging in disutils
distutils.log.set_verbosity(distutils.log.DEBUG) # Set DEBUG level

All distutils's logging levels available:

DEBUG = 1
INFO = 2
WARN = 3
ERROR = 4
FATAL = 5

You can see the source code of the class "Log" of distutils for reference. Usually for Python 2.7 in /usr/lib/python2.7/distutils/log.py

The verbose option is not additive, it converts to a boolean. Thus no matter how many times you invoke the verbose option it will always be 1 and 1 always sets the level to INFO, which is the default anyway.

Passing the -v parameter to python setup.py build to increase verbosity usually works to get more detailed errors.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!