logApi.py 322 B

123456789
  1. import logging
  2. logger = logging.getLogger(__name__)
  3. logger.setLevel(level = logging.INFO)
  4. handler = logging.FileHandler("logs/api.txt")
  5. handler.setLevel(logging.INFO)
  6. formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
  7. handler.setFormatter(formatter)
  8. logger.addHandler(handler)