config.py 444 B

123456789101112131415
  1. #!-*-coding:utf-8 -*-
  2. import os
  3. import logging
  4. root = "c:\\AppData\\say365"
  5. if not os.path.exists(root):
  6. os.makedirs(root)
  7. xlog = logging.getLogger('[XscanService]')
  8. handler = logging.FileHandler(os.path.join(root, "service.log"))
  9. formatter = logging.Formatter('%(asctime)s [%(name)s:%(lineno)d] [%(module)s:%(funcName)s] [%(levelname)s]- %(message)s')
  10. handler.setFormatter(formatter)
  11. xlog.addHandler(handler)
  12. xlog.setLevel(logging.INFO)