docs: def log_to_file(filename, level=None, fmt=None, datefmt=None):
      """
      Send log output to the given file.
  
      Parameters
      ----------
      filename : str
      level : int, optional
          An optional logging level that will apply only to this stream
          handler.
      fmt : str, optional
          An optional format string that will be used for the log
          messages.
      datefmt : str, optional
          An optional format string for formatting dates in the log
          messages.
  
      """
      _add_log_handler(
          logging.FileHandler(filename), fmt=fmt, datefmt=datefmt)