text: import logging
  
  
  class Logger(object):
      def __init__(self, log_file_name, log_level, logger_name):
          # firstly, create a logger
          self.__logger = logging.getLogger(logger_name)
          self.__logger.setLevel(log_level)
          # secondly, create a handler
          file_handler = logging.FileHandler(log_file_name)
          console_handler = logging.StreamHandler()
          # thirdly, define the output form of handler
          formatter = logging.Formatter(
              "[%(asctime)s]-[%(filename)s line:%(lineno)d]:%(message)s "
          )
          file_handler.setFormatter(formatter)
          console_handler.setFormatter(formatter)
          # finally, add the Hander to logger
          self.__logger.addHandler(file_handler)
          self.__logger.addHandler(console_handler)
  
      def get_log(self):
          return self.__logger
  