logging 使用实例
import logging
logging.basicConfig(
level=logging.DEBUG,
filename="output.log",
datefmt="%Y/%m/%d %H:%M:%S",
format="%(asctime)s - %(name)s - %(levelname)s - %(lineno)d - %(module)s - %(message)s",
)
logger = logging.getLogger(__name__)
logger.info("This is a log info")
logger.debug("Debugging")
logger.warning("Warning exists")
logger.info("Finish")
标签:info,__,logging,log,用法,模块,logger,name
From: https://www.cnblogs.com/wl30564/p/17182869.html