code: def set_up_log(filename, verbose=True):
      
  
      # Add file extension.
      filename += '.log'
  
      if verbose:
          print('Preparing log file:', filename)
  
      # Capture warnings.
      logging.captureWarnings(True)
  
      # Set output format.
      formatter = logging.Formatter(fmt='%(asctime)s %(message)s',
                                    datefmt='%d/%m/%Y %H:%M:%S')
  
      # Create file handler.
      fh = logging.FileHandler(filename=filename, mode='w')
      fh.setLevel(logging.DEBUG)
      fh.setFormatter(formatter)
  
      # Create log.
      log = logging.getLogger(filename)
      log.setLevel(logging.DEBUG)
      log.addHandler(fh)
  
      # Send opening message.
      log.info('The log file has been set-up.')
  
      return log
docs: Set up log
  
      This method sets up a basic log.
  
      Parameters
      ----------
      filename : str
          Log file name
  
      Returns
      -------
      logging.Logger instance