code: def reset_logformat(logger: logging.Logger,
                      fmt: str,
                      datefmt: str = '%Y-%m-%d %H:%M:%S') -> None:
      
      handler = logging.StreamHandler()
      formatter = logging.Formatter(fmt=fmt, datefmt=datefmt)
      handler.setFormatter(formatter)
      remove_all_logger_handlers(logger)
      logger.addHandler(handler)
      logger.propagate = False
docs: Create a new formatter and apply it to the logger.
  
      :func:`logging.basicConfig` won't reset the formatter if another module
      has called it, so always set the formatter like this.
  
      Args:
          logger: logger to modify
          fmt: passed to the ``fmt=`` argument of :class:`logging.Formatter`
          datefmt: passed to the ``datefmt=`` argument of
              :class:`logging.Formatter`