logger.py 389 B

1234567891011
  1. import logging
  2. logger = logging.getLogger("bot")
  3. logger.setLevel(logging.INFO)
  4. fh = logging.FileHandler('stable_diffusion_bot.log')
  5. fh.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
  6. logger.addHandler(fh)
  7. ch = logging.StreamHandler()
  8. ch.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
  9. logger.addHandler(ch)