import logging
from logging.handlers import TimedRotatingFileHandler
# 配置日志
handlers = [TimedRotatingFileHandler("log\\app.log",when="H",interval=12,backupCount=7),logging.StreamHandler()]
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(levelname)s - %(message)s',
    handlers=handlers
)

logger = logging.getLogger(__name__)

