📜  在 python 代码示例中制作日志文件

📅  最后修改于: 2022-03-11 14:45:21.063000             🧑  作者: Mango

代码示例3
import logging
logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')
logging.error('And non-ASCII stuff, too, like Øresund and Malmö')