當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。