log.py 693 B

1234567891011121314151617
  1. # import logging
  2. #
  3. # logger = logging.getLogger(__name__)
  4. # logger.setLevel(level = logging.INFO)
  5. # handler = logging.FileHandler("logs/creditReport.txt")
  6. # handler.setLevel(logging.INFO)
  7. # formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
  8. # handler.setFormatter(formatter)
  9. # logger.addHandler(handler)
  10. import logging
  11. from mpFileLog import MPFileLogHandler
  12. logger_handler = MPFileLogHandler('logs/creditReport.txt')
  13. logger = logging.getLogger('info')
  14. formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
  15. logger_handler.setFormatter(formatter)
  16. logger.addHandler(logger_handler)
  17. logger.setLevel(logging.ERROR)