本文整理汇总了Python中process.logging.Logger.debug方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.debug方法的具体用法?Python Logger.debug怎么用?Python Logger.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类process.logging.Logger
的用法示例。
在下文中一共展示了Logger.debug方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from process.logging import Logger [as 别名]
# 或者: from process.logging.Logger import debug [as 别名]
def execute(self, sql, params=None, timeout = 0):
cursor = self.db_conn.cursor(cursorclass=Dbi.cursors.DictCursor)
deathClock = None
if self.debug:
if params:
log.debug(str(sql) + " % " + repr(params))
else:
log.debug(str(sql))
if timeout > 0:
deathClock = threading.Timer(timeout, self.kill_connection)
deathClock.start()
try:
if params:
cursor.execute(sql, params)
elif hasattr(sql, 'uninterpolated_sql') and sql.params:
cursor.execute(sql.uninterpolated_sql(), sql.params)
else:
cursor.execute(str(sql))
#for row in cursor.fetchall():
# yield row
out = cursor.fetchall()
cursor.close()
return out
finally:
if deathClock is not None:
deathClock.cancel()
示例2: is_fr_test
# 需要导入模块: from process.logging import Logger [as 别名]
# 或者: from process.logging.Logger import debug [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))
示例3: execute
# 需要导入模块: from process.logging import Logger [as 别名]
# 或者: from process.logging.Logger import debug [as 别名]
def execute(self, sql, params=None):
cursor = self.db_conn.cursor(cursorclass=Dbi.cursors.DictCursor)
if self.debug:
if params:
log.debug(str(sql) + " % " + repr(params))
else:
log.debug(str(sql))
if params:
cursor.execute(sql, params)
elif hasattr(sql, 'uninterpolated_sql') and sql.params:
cursor.execute(sql.uninterpolated_sql(), sql.params)
else:
cursor.execute(str(sql))
#for row in cursor.fetchall():
# yield row
out = cursor.fetchall()
cursor.close()
return out
示例4: update_gdoc_results
# 需要导入模块: from process.logging import Logger [as 别名]
# 或者: from process.logging.Logger import debug [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)