logger.setLevel(logging.INFO)
if logger.handlers:
    logger.handlers = []
fh = logging.FileHandler(LOG_FILENAME)
formatter = logging.Formatter(FORMAT)
fh.setFormatter(formatter)
logger.addHandler(fh)
return logger
python logger logging same entry numerous times