log.py 228 B

123456789
  1. import logging
  2. def getlogger():
  3. # 初始化
  4. logging.basicConfig(level=logging.WARNING, format='%(asctime)s - %(name)s - %(message)s')
  5. # 生成日志句柄
  6. logger = logging.getLogger("logger")
  7. return logger