本文整理汇总了Python中distutils.log.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Python log.DEBUG属性的具体用法?Python log.DEBUG怎么用?Python log.DEBUG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类distutils.log
的用法示例。
在下文中一共展示了log.DEBUG属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _log
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import DEBUG [as 别名]
def _log(self, level, msg, args):
if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
raise ValueError('%s wrong log level' % str(level))
self.logs.append((level, msg, args))
示例2: _log
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import DEBUG [as 别名]
def _log(self, level, msg, args):
if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
raise ValueError('%s wrong log level' % str(level))
if not isinstance(msg, str):
raise TypeError("msg should be str, not '%.200s'"
% (type(msg).__name__))
self.logs.append((level, msg, args))
示例3: _log
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import DEBUG [as 别名]
def _log(self, level, msg, args):
if level not in (log.DEBUG, log.INFO, log.WARN, log.ERROR, log.FATAL):
raise ValueError('%s wrong log level' % str(level))
self.logs.append((level, msg, args))
示例4: run
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import DEBUG [as 别名]
def run(self):
cwd = os.path.realpath(os.curdir)
if self.inplace:
dist_root = cwd
else:
build_cmd = self.get_finalized_command('build')
dist_root = os.path.realpath(build_cmd.build_lib)
output_dir = os.path.join(dist_root, MJBINDINGS_DIR)
command = [
sys.executable or 'python',
AUTOWRAP_PATH,
'--header_paths={}'.format(self.header_paths),
'--output_dir={}'.format(output_dir)
]
self.announce('Running command: {}'.format(command), level=log.DEBUG)
try:
# Prepend the current directory to $PYTHONPATH so that internal imports
# in `autowrap` can succeed before we've installed anything.
old_environ = os.environ.copy()
new_pythonpath = [cwd]
if 'PYTHONPATH' in old_environ:
new_pythonpath.append(old_environ['PYTHONPATH'])
os.environ['PYTHONPATH'] = ':'.join(new_pythonpath)
subprocess.check_call(command)
finally:
os.environ = old_environ