code: def copy_all_logs_to_file(filename: str,
                            fmt: str = LOG_FORMAT,
                            datefmt: str = LOG_DATEFMT) -> None:
      
      fh = logging.FileHandler(filename)
      # default file mode is 'a' for append
      formatter = logging.Formatter(fmt=fmt, datefmt=datefmt)
      fh.setFormatter(formatter)
      apply_handler_to_all_logs(fh)
docs: Copy all currently configured logs to the specified file.
  
      Should ONLY be called from the ``if __name__ == 'main'`` script;
      see https://docs.python.org/3.4/howto/logging.html#library-config.
  
      Args:
          filename: file to send log output to
          fmt: passed to the ``fmt=`` argument of :class:`logging.Formatter`
          datefmt: passed to the ``datefmt=`` argument of
              :class:`logging.Formatter`