# logging导入 import logging # 设置打印的最低级别 logging.basicConfig(level = logging.DEBUG)
debug, info, warning,errorlevel从低往高
debug
info
warning
error
log.debug("n = %d" %n) log.info("n = %d" %n) log.warning("n = %d" %n) log.error("n = %d" %n)