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


Python Logger.warn方法代码示例

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


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

示例1: is_fr_test

# 需要导入模块: from process.logging import Logger [as 别名]
# 或者: from process.logging.Logger import warn [as 别名]
def is_fr_test(test):
    if test.label and test.banners and test.campaign:
        is_chapter = re.search(config.fr_chapter_test, test.banners[0])
        if is_chapter:
            log.debug("Determined test {title} belongs to a chapter".format(title=test.label))
        else:
            log.debug("Determined test {title} belongs to Fundraising".format(title=test.label))
        return not is_chapter

    log.warn("missing data for test {title}".format(title=test.label))
开发者ID:mikebirduk,项目名称:wikimedia-fundraising-tools,代码行数:12,代码来源:spec.py

示例2: update_gdoc_results

# 需要导入模块: from process.logging import Logger [as 别名]
# 或者: from process.logging.Logger import warn [as 别名]
def update_gdoc_results(doc=None, results=[]):
    log.info("Updating results in {url}".format(url=doc))
    doc = Spreadsheet(doc=doc)
    existing = list(doc.get_all_rows())

    def find_matching_cases(criteria):
        matching = []

        def fuzzy_compare_row(row, criteria):
            if not row:
                return False
            if criteria['banner'] == row['banner'] and criteria['campaign'] == row['campaign'] and criteria['start'] == row['start']:
                return True

        for n, row in enumerate(existing, 1):
            if fuzzy_compare_row(row, criteria):
                matching.append(n)

        return matching

    for result in results:
        if not result:
            continue

        matching = find_matching_cases(result['criteria'])

        props = {}
        props.update(result['results'])
        props.update(result['criteria'])

        if len(matching) == 0:
            doc.append_row(props)
        else:
            if len(matching) > 1:
                log.warn("more than one result row {match} matches criteria: {criteria}".format(match=matching, criteria=result['criteria']))
            index = matching[-1]
            log.debug("updating row {rownum} with {banner}".format(rownum=index, banner=result['criteria']['banner']))
            doc.update_row(props, index=index)
开发者ID:mikebirduk,项目名称:wikimedia-fundraising-tools,代码行数:40,代码来源:results_gdoc.py

示例3: kill_connection

# 需要导入模块: from process.logging import Logger [as 别名]
# 或者: from process.logging.Logger import warn [as 别名]
 def kill_connection(self):
     log.warn('Query taking too long - killing connection {}'.format(self.connection_id))
     killerConnection = Dbi.connect(**self.connectionArgs)
     cursor = killerConnection.cursor()
     cursor.execute('KILL CONNECTION {}'.format(self.connection_id))
     killerConnection.close()
开发者ID:mikebirduk,项目名称:wikimedia-fundraising-tools,代码行数:8,代码来源:db.py


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