import logging
此模块用来打印输出格式
logging.basicConfig(level=logging.INFO,format=‘%(asctime)s %(levelname)s [%(threadName)s] - %(message)s‘)
level:
logging.INFO:日志级别
format:
%(asctime)s:打印出时间
%(levelname)s:打印出日志级别
%(threadName)s:线程名字
%(message)s:打出输出消息
打印出输出信息:
logging.info(‘test‘)
时间: 2024-11-05 06:00:57