code: def setup_logging(cli_options):
      
      if cli_options.debug_info or get_debug_level() > 0:
          levels = {2: logging.INFO, 3: logging.DEBUG}
          log_level = levels[get_debug_level()]
          log_format = '%(asctime)s [%(levelname)s] [%(name)s] -> %(message)s'
  
          if cli_options.debug_output == 'file':
              log_file = 'spyder-debug.log'
          else:
              log_file = None
  
          logging.basicConfig(level=log_level,
                              format=log_format,
                              filename=log_file,
                              filemode='w+')
docs: Setup logging with cli options defined by the user.