code: def _setup_file_logger(cls, session: AppSession, args):
          '''Set up the file message logger.
  
          A file log handler and with a formatter is added to the root logger.
          '''
          if not (args.output_file or args.append_output):
              return
  
          logger = logging.getLogger()
  
          formatter = logging.Formatter(
              '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
  
          if args.output_file:
              filename = args.output_file
              mode = 'w'
          else:
              filename = args.append_output
              mode = 'a'
  
          session.file_log_handler = handler = logging.FileHandler(
              filename, mode, encoding='utf-8')
          handler.setFormatter(formatter)
          logger.addHandler(handler)
  
          if args.verbosity == logging.DEBUG:
              handler.setLevel(logging.DEBUG)
          else:
              handler.setLevel(logging.INFOf _setup_file_logger(cls, session: AppSession, args):
          '''Set up the file message logger.
  
          A file log handler and with a formatter is added to the root logger.
          '''
          if not (args.output_file or args.append_output):
              return
  
          logger = logging.getLogger()
  
          formatter = logging.Formatter(
              '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
  
          if args.output_file:
              filename = args.output_file
              mode = 'w'
          else:
              filename = args.append_output
              mode = 'a'
  
          session.file_log_handler = handler = logging.FileHandler(
              filename, mode, encoding='utf-8')
          handler.setFormatter(formatter)
          logger.addHandler(handler)
  
          if args.verbosity == logging.DEBUG:
              handler.setLevel(logging.DEBUG)
          else:
              handler.setLevel(logging.INFO)
docs: Set up the file message logger.
  
          A file log handler and with a formatter is added to the root logger.