docs: def logToFile(path, level=logging.INFO):
      """
      Create a log handler that logs to the given file.
      """
      logger = logging.getLogger()
      logger.setLevel(level)
      formatter = logging.Formatter(
          '%(asctime)s %(name)s %(levelname)s %(message)s')
      handler = logging.FileHandler(path)
      handler.setFormatter(formatter)
      logger.addHandler(handler)