import logging
# 打印日志级别
def test_logging():
    logging.basicConfig(filename='F:/example.log', level=logging.DEBUG)
    logging.debug('This message should go to the log file')
    logging.info('So should this')
    logging.warning('And this, too')
def main():
    test_logging()
if __name__ == "__main__":
    main()
版权声明:本文为博主原创文章,未经博主允许不得转载。
Python
 CNDBA社区
CNDBA社区
 
					
				
			

