当前位置: 首页>>代码示例>>Python>>正文


Python logger.error方法代码示例

本文整理汇总了Python中pip.log.logger.error方法的典型用法代码示例。如果您正苦于以下问题:Python logger.error方法的具体用法?Python logger.error怎么用?Python logger.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pip.log.logger的用法示例。


在下文中一共展示了logger.error方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _build_one

# 需要导入模块: from pip.log import logger [as 别名]
# 或者: from pip.log.logger import error [as 别名]
def _build_one(self, req):
        """Build one wheel."""

        base_args = [
            sys.executable, '-c',
            "import setuptools;__file__=%r;"\
            "exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))" % req.setup_py] + \
            list(self.global_options)

        logger.notify('Running setup.py bdist_wheel for %s' % req.name)
        logger.notify('Destination directory: %s' % self.wheel_dir)
        wheel_args = base_args + ['bdist_wheel', '-d', self.wheel_dir] + self.build_options
        try:
            call_subprocess(wheel_args, cwd=req.source_dir, show_stdout=False)
            return True
        except:
            logger.error('Failed building wheel for %s' % req.name)
            return False 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:20,代码来源:wheel.py

示例2: read_text_file

# 需要导入模块: from pip.log import logger [as 别名]
# 或者: from pip.log.logger import error [as 别名]
def read_text_file(filename):
    """Return the contents of *filename*.

    Try to decode the file contents with utf-8, the preffered system encoding
    (e.g., cp1252 on some Windows machines) and latin1, in that order. Decoding
    a byte string with latin1 will never raise an error. In the worst case, the
    returned string will contain some garbage characters.

    """
    with open(filename, 'rb') as fp:
        data = fp.read()

    encodings = ['utf-8', locale.getpreferredencoding(False), 'latin1']
    for enc in encodings:
        try:
            data = data.decode(enc)
        except UnicodeDecodeError:
            continue
        break

    assert type(data) != bytes  # Latin1 should have worked.
    return data 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:24,代码来源:req.py

示例3: rollback_uninstall

# 需要导入模块: from pip.log import logger [as 别名]
# 或者: from pip.log.logger import error [as 别名]
def rollback_uninstall(self):
        if self.uninstalled:
            self.uninstalled.rollback()
        else:
            logger.error("Can't rollback %s, nothing uninstalled."
                         % (self.project_name,)) 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:8,代码来源:req.py

示例4: commit_uninstall

# 需要导入模块: from pip.log import logger [as 别名]
# 或者: from pip.log.logger import error [as 别名]
def commit_uninstall(self):
        if self.uninstalled:
            self.uninstalled.commit()
        else:
            logger.error("Can't commit %s, nothing uninstalled."
                         % (self.project_name,)) 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:8,代码来源:req.py

示例5: rollback

# 需要导入模块: from pip.log import logger [as 别名]
# 或者: from pip.log.logger import error [as 别名]
def rollback(self):
        """Rollback the changes previously made by remove()."""
        if self.save_dir is None:
            logger.error("Can't roll back %s; was not uninstalled" % self.dist.project_name)
            return False
        logger.notify('Rolling back uninstall of %s' % self.dist.project_name)
        for path in self._moved_paths:
            tmp_path = self._stash(path)
            logger.info('Replacing %s' % path)
            renames(tmp_path, path)
        for pth in self.pth:
            pth.rollback() 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:14,代码来源:req.py


注:本文中的pip.log.logger.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。