本文整理汇总了Python中cylc.suite_logging.LOG.setLevel方法的典型用法代码示例。如果您正苦于以下问题:Python LOG.setLevel方法的具体用法?Python LOG.setLevel怎么用?Python LOG.setLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cylc.suite_logging.LOG
的用法示例。
在下文中一共展示了LOG.setLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from cylc.suite_logging import LOG [as 别名]
# 或者: from cylc.suite_logging.LOG import setLevel [as 别名]
def main():
"""Manual test playground."""
LOG.setLevel(logging.INFO) # or logging.DEBUG
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.DEBUG)
LOG.addHandler(handler)
def print_result(result):
"""Print result"""
if result['OUT']:
LOG.info('result> ' + result['OUT'].strip())
if result['ERR']:
LOG.info('FAILED> ' + result['CMD'])
LOG.info(result['ERR'].strip())
pool = mp_pool(3)
for i in range(3):
com = "sleep 5 && echo Hello from JOB " + str(i)
pool.put_command(SuiteProcPool.JOBS_SUBMIT, com, print_result)
com = "sleep 5 && echo Hello from POLL " + str(i)
pool.put_command("poll", com, print_result)
com = "sleep 5 && echo Hello from HANDLER " + str(i)
pool.put_command("event-handler", com, print_result)
com = "sleep 5 && echo Hello from HANDLER && badcommand"
pool.put_command("event-handler", com, print_result)
LOG.info(' sleeping')
time.sleep(3)
pool.handle_results_async()
LOG.info(' sleeping')
time.sleep(3)
pool.close()
# pool.terminate()
pool.handle_results_async()
LOG.info(' sleeping')
time.sleep(3)
pool.join()
pool.handle_results_async()