本文整理汇总了Python中core.logger.Logger.debug方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.debug方法的具体用法?Python Logger.debug怎么用?Python Logger.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.logger.Logger
的用法示例。
在下文中一共展示了Logger.debug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from core.logger import Logger [as 别名]
# 或者: from core.logger.Logger import debug [as 别名]
success = False
try:
success = handler.run(section=section, **kwargs)
except CancelException, e:
handler.update_status(False)
log.info('Task "%s" was cancelled', key)
except Exception, ex:
handler.update_status(False)
log.error('Exception raised in handler for %r: %s', key, ex, exc_info=True)
log.debug(
'Cache Statistics - len(matcher): %s, len(metadata): %s',
len(CacheManager.get('matcher')),
len(CacheManager.get('metadata'))
)
# Sync "matcher" cache (back to disk)
CacheManager.get('matcher').sync()
# Clear memory caches
CacheManager.get('matcher').cache.clear()
CacheManager.get('metadata').cache.clear()
# Run garbage collection
log.debug('[GC] Collected %d objects', gc.collect())
log.debug('[GC] Count: %s', gc.get_count())
log.debug('[GC] Garbage: %s', len(gc.garbage))
示例2: spawn
# 需要导入模块: from core.logger import Logger [as 别名]
# 或者: from core.logger.Logger import debug [as 别名]
def spawn(func, *args, **kwargs):
thread_name = kwargs.pop('thread_name', None) or get_func_name(func)
def wrapper(thread_name, args, kwargs):
try:
func(*args, **kwargs)
except Exception, ex:
log.error('Thread "%s" raised an exception: %s', thread_name, ex, exc_info=True)
th = threading.Thread(target=wrapper, name=thread_name, args=(thread_name, args, kwargs))
try:
th.start()
log.debug("Spawned thread with name '%s'" % thread_name)
except thread.error, ex:
log.error('Unable to spawn thread: %s', ex, exc_info=True, extra={
'data': {
'active_count': threading.active_count()
}
})
return None
return th
def schedule(func, seconds, *args, **kwargs):
def schedule_sleep():
time.sleep(seconds)
func(*args, **kwargs)