import logging
log_file = '/tmp/service.log'
LOG_FORMAT = "%(asctime)s %(levelname)s %(message)s"
logging.basicConfig(filename=log_file, level=logging.DEBUG, format=LOG_FORMAT)
logging.info('some msg')
import logging
log_file = '/tmp/service.log'
LOG_FORMAT = "%(asctime)s %(levelname)s %(message)s"
logging.basicConfig(filename=log_file, level=logging.DEBUG, format=LOG_FORMAT)
logging.info('some msg')
本文标题:Python中打印日志
本文链接:https://www.haomeiwen.com/subject/lljsirtx.html
网友评论