code: def log_to_file(logdir, mode='a', delete=False, clearmem=True):
      
      logger = FileLogger(logdir, mode, delete, clearmem)
      _loggers.append(logger)
      return log_to(logger)
docs: Like :class:`log_to()`, but automatically creates a new FileLogger
      instead of having one passed.
      Note that the logger stays alive (in memory) forever. If you need
      to control the lifetime of a logger, use :class:`log_to()` instead.