本文整理匯總了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