我无法在Python 3.3上重现它。消息将同时写入屏幕和
'example2.log'。在Python <3.3上,它将创建文件,但为空。
编码:
from logging_tree import printout # pip install logging_treeprintout()
显示
FileHandler()在Python <3.3上未附加到根记录器。
logging.basicConfig()表示该
handlers参数的文档是在Python
3.3中添加的。
handlersPython 3.2文档中未提及该参数。



