from Tools import CSDN
import logging
LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
logging.basicConfig( filename = 'my.log', level = logging.WARNING,format = LOG_FORMAT)
# 日志文件的基本配置
log = logging.getLogger(__name__)
# 获得日志文件实例
log.warning("This is a warning log.")
# 提交日志