# import logging # logger = logging.getLogger(__name__) # logger.setLevel(level = logging.INFO) # handler = logging.FileHandler("logs/result.txt") # handler.setLevel(logging.INFO) # formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') # handler.setFormatter(formatter) # logger.addHandler(handler) import logging from mpFileLog import MPFileLogHandler logger_handler = MPFileLogHandler('logs/result.txt') logger = logging.getLogger('result') formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger_handler.setFormatter(formatter) logger.addHandler(logger_handler) logger.setLevel(logging.ERROR)