如何在Python中获取Disutils设置的错误日志? [英] How to get error log of a disutils setup in Python?
问题描述
我是Python的新手。我已经为Python创建了一些C / C ++扩展,并且能够借助Python disutils安装脚本来构建这些扩展。但是,我必须将此安装脚本集成到现有的构建系统中。因此,我编写了另一个脚本,使用run_setup()方法调用此安装脚本。
I am new to Python. I have created some C/C++ extensions for Python and able to build those with the help of Python disutils setup script. But, I have to integrate this setup script to an existing build system. So, I wrote another script to call this setup script using run_setup() method.
distributionObj = run_setup("setup.py",["build_ext"])
现在,我想在构建扩展程序(编译器,链接器或其他任何东西)时发生任何错误,我必须能够将信息与调用者脚本中的错误字符串以通知生成过程。
Now, I want if any error occurs during the building of extension (Compiler, Linker or anything), I must be able to get the information along with the error string from the caller script to notify the build process.
请提供一些建议。
推荐答案
在环境中设置DISTUTILS_DEBUG = 1将导致调试日志记录。
Setting DISTUTILS_DEBUG=1 in the environment will cause debug logging.
这篇关于如何在Python中获取Disutils设置的错误日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!