code: def add_root_log_file(log_file):
      
      root_logger = logging.getLogger()
  
      # add a file handle to the root logger
      hdlr = logging.FileHandler(log_file)
      formatter = logging.Formatter('%(asctime)s %(name)-10s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M:%S')
      hdlr.setFormatter(formatter)
      root_logger.addHandler(hdlr)
      root_logger.info('Root logger now logging to {}'.format(log_file))
docs: Add a log file to the root logger.
  
      Parameters
      ----------
      log_file :obj:`str`
          The path to the log file.