import logging
logging.basicConfig(level=logging.INFO)
logging.info("this statement is printed")
logger = logging.getLogger(name=None)
logger.setLevel(logging.ERROR)
logging.error("this statement is printed")
logger.error("this statement is printed")
logging.info("this statement IS NOT printed")
为什么最后一行没有打印?我认为只有新的记录器设置为错误级别。为什么logging.info不再起作用? 谢谢。