我使用python日志记录模块,该进程突然进入睡眠模式3个小时。可能是什么原因?与日志记录相关的代码如下。
a1.py
logger = logging.getLogger(__name__)
logger.info("foo")
a2.py
logger = logging.getLogger(__name__)
logger.info("bar")
main.py
logging.basicConfig(filename=str(final_log_file), format=head)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
console = logging.StreamHandler() # <--- comment it and error goes away
logging.getLogger('').addHandler(console) # <--- comment it and error goes away