📜  在 python 代码示例中创建日志

📅  最后修改于: 2022-03-11 14:47:02.729000             🧑  作者: 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ö')