Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

logger.py 388B

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. """
  3. Helper class for using logging as trace file object
  4. """
  5. import logging
  6. class logging_file_class(object):
  7. def __init__(self, logging_level):
  8. self._logging_level = logging_level
  9. def write(self, msg):
  10. logging.log(self._logging_level, msg[:-1])
  11. def flush(self):
  12. return
  13. logging_file_obj = logging_file_class(logging.DEBUG)