code: def _setup_console_logger(cls, session: AppSession, args, stderr):
          '''Set up the console logger.
  
          A handler and with a formatter is added to the root logger.
          '''
          stream = new_encoded_stream(args, stderr)
  
          logger = logging.getLogger()
          session.console_log_handler = handler = logging.StreamHandler(stream)
  
          formatter = logging.Formatter('%(levelname)s %(message)s')
          log_filter = logging.Filter('wpull')
  
          handler.setFormatter(formatter)
          handler.setLevel(args.verbosity or logging.INFO)
          handler.addFilter(log_filter)
          logger.addHandler(handlerf _setup_console_logger(cls, session: AppSession, args, stderr):
          '''Set up the console logger.
  
          A handler and with a formatter is added to the root logger.
          '''
          stream = new_encoded_stream(args, stderr)
  
          logger = logging.getLogger()
          session.console_log_handler = handler = logging.StreamHandler(stream)
  
          formatter = logging.Formatter('%(levelname)s %(message)s')
          log_filter = logging.Filter('wpull')
  
          handler.setFormatter(formatter)
          handler.setLevel(args.verbosity or logging.INFO)
          handler.addFilter(log_filter)
          logger.addHandler(handler)
docs: Set up the console logger.
  
          A handler and with a formatter is added to the root logger.