Tag Archives: log

Python的Basic日志模板

日志配置:
import logging
fmt = “%(asctime)s [%(levelname)s] %(message)s”
logging.basicConfig(format=fmt, filename=”xxx.log”, level=logging.INFO)
日志器获取、使用:
LOG = logging.getLogger(CONF.LOG_NAME)
LOG.info(“xxx” % (…) )
LOG.debug(“x” % (…) )
201[……]

继续阅读