code: def _add_filehandler(logger, logpath, formatter=None, name="Bench"):
      
      formatter = formatter if formatter else BenchFormatterWithType(loggername=name)
      handler = _get_filehandler_with_formatter(logpath, formatter)
      config = LOGGING_CONFIG.get(name, {}).get("file", DEFAULT_LOGGING_CONFIG.get("file"))
      handler.setLevel(getattr(logging, config.get("level", "DEBUG")))
      logger.addHandler(handler)
      return logger
docs: Adds a FileHandler to logger.
  
      :param logger: Logger.
      :param logpath: Path to file.
      :param formatter: Formatter to be used
      :param name: Name for logger
      :return: Logger