Log the most important parts of this request.

        :param request: Object representing the current request.
        :type request: :class:`webob.Request`
972191
def _log_request(self, request):
        
        msg = []
        for d in self.LOG_DATA:
            val = getattr(request, d)
            if val:
                msg.append(d + ': ' + repr(val))
        for d in self.LOG_HEADERS:
            if d in request.headers and request.headers[d]:
                msg.append(d + ': ' + repr(request.headers[d]))
        logger.info("Request information: %s", ', '.join(msg))
113715
def should_log(self, request, response):
        
        return self.logging_methods == '__all__' or request.method in self.logging_methods
719480
def request(self, request):
        

        url = "{}{}".format(self._base_url, request.path)

        timeout = self.poll_timeout

        if request.stream is True:
            timeout = self.stream_timeout

        try:
            http_response = self._session.request(
                request.method,
                url,
                headers=self._headers,
                params=request.params,
                data=request.body,
                stream=request.stream,
                timeout=timeout
            )
        except requests.exceptions.ConnectionError:
            raise V20ConnectionError(url)
        except requests.exceptions.ConnectTimeout:
            raise V20Timeout(url, "connect")
        except requests.exceptions.ReadTimeout:
            raise V20Timeout(url, "read")

        request.headers = http_response.request.headers

        response = Response(
            request,
            request.method,
            http_response.url,
            http_response.status_code,
            http_response.reason,
            http_response.headers
        )

        if request.stream:
            response.set_line_parser(
                request.line_parser
            )

            response.set_lines(
                http_response.iter_lines(
                    self.stream_chunk_size
                )
            )
        else:
            response.set_raw_body(http_response.text)

        return response
891841
def prepare_request(self, *args, **kw):
        
        self.http_request = self.request_class(self.path, *args, **kw)
582926
def log(self, request, spider):
        
        if self.debug:
            msg = "Filtered duplicate request: %(request)s"
            self.logger.debug(msg, {'request': request}, extra={'spider': spider})
        elif self.logdupes:
            msg = ("Filtered duplicate request %(request)s"
                   " - no more duplicates will be shown"
                   " (see DUPEFILTER_DEBUG to show all duplicates)")
            self.logger.debug(msg, {'request': request}, extra={'spider': spider})
            self.logdupes = False
537375
def after_request_log(target_url, opts, response)
      <<-LOG
Finish request #{opts[:method].upcase} #{target_url} with #{response.code}
#{response.body}
      LOG
    end
1029610
def basic_logging(self) -> None:
        
        # Request handler
        if len(request_log.handlers) == 0:
            request_handler = logging.StreamHandler()
            request_handler.setFormatter(
                logging.Formatter(fmt=self.DEFAULT_REQUEST_LOG_FORMAT)
            )
            request_log.addHandler(request_handler)
            request_log.setLevel(logging.INFO)
        # Response handler
        if len(response_log.handlers) == 0:
            response_handler = logging.StreamHandler()
            response_handler.setFormatter(
                logging.Formatter(fmt=self.DEFAULT_RESPONSE_LOG_FORMAT)
            )
            response_log.addHandler(response_handler)
            response_log.setLevel(logging.INFO)
129544
def report(self, request: 'Request'=None, state: Text=None):
        
        self._make_context(request, state)
        self.client.captureException()
        self._clear_context()
1310086
def check(self, request):
        
        if callable(self.check_func):
            self.visible = self.check_func(request)
793124
function logRequest(err, res) {
    if (res) {
      let ms = new Date() - res.requestStartTime;

      var time = ms < 1000 ? `${ms}ms` : `${(ms/1000).toFixed(2)}s`;

      logRoute(`${res.req.method} ${res.statusCode} (${time}): ${res.req.originalUrl}`);
    }
  }
417368
private void handleSortRequest(final Request request) {
		String sortColStr = request.getParameter(getId() + ".sort");
		String sortDescStr = request.getParameter(getId() + ".sortDesc");

		if (sortColStr != null) {
			if ("".equals(sortColStr)) {
				// Reset sort
				setSort(-1, false);
				getOrCreateComponentModel().rowIndexMapping = null;
			} else {
				try {
					int sortCol = Integer.parseInt(sortColStr);
					// Allow for column order
					int[] cols = getColumnOrder();
					if (cols != null) {
						sortCol = cols[sortCol];
					}
					boolean sortAsc = !"true".equalsIgnoreCase(sortDescStr);

					// Only process the sort request if it differs from the current sort order
					if (sortCol != getSortColumnIndex() || sortAsc != isSortAscending()) {
						sort(sortCol, sortAsc);
						setFocussed();
					}
				} catch (NumberFormatException e) {
					LOG.warn("Invalid sort column: " + sortColStr);
				}
			}
		}
	}
715837
def _process_request(self, request):
        """"""

        request.horizon = {'dashboard': None,
                           'panel': None,
                           'async_messages': []}
        if not hasattr(request, "user") or not request.user.is_authenticated:
            # proceed no further if the current request is already known
            # not to be authenticated
            # it is CRITICAL to perform this check as early as possible
            # to avoid creating too many sessions
            return None

        # Since we know the user is present and authenticated, lets refresh the
        # session expiry if configured to do so.
        if getattr(settings, "SESSION_REFRESH", True):
            timeout = getattr(settings, "SESSION_TIMEOUT", 3600)
            token_life = request.user.token.expires - datetime.datetime.now(
                pytz.utc)
            session_time = min(timeout, int(token_life.total_seconds()))
            request.session.set_expiry(session_time)

        if request.is_ajax():
            # if the request is Ajax we do not want to proceed, as clients can
            #  1) create pages with constant polling, which can create race
            #     conditions when a page navigation occurs
            #  2) might leave a user seemingly left logged in forever
            #  3) thrashes db backed session engines with tons of changes
            return None
        # If we use cookie-based sessions, check that the cookie size does not
        # reach the max size accepted by common web browsers.
        if (
            settings.SESSION_ENGINE ==
            'django.contrib.sessions.backends.signed_cookies'
        ):
            max_cookie_size = getattr(
                settings, 'SESSION_COOKIE_MAX_SIZE', None)
            session_cookie_name = getattr(
                settings, 'SESSION_COOKIE_NAME', None)
            session_key = request.COOKIES.get(session_cookie_name)
            if max_cookie_size is not None and session_key is not None:
                cookie_size = sum((
                    len(key) + len(value)
                    for key, value in request.COOKIES.items()
                ))
                if cookie_size >= max_cookie_size:
                    LOG.error(
                        'Total Cookie size for user_id: %(user_id)s is '
                        '%(cookie_size)sB >= %(max_cookie_size)sB. '
                        'You need to configure file-based or database-backed '
                        'sessions instead of cookie-based sessions: '
                        'https://docs.openstack.org/horizon/latest/'
                        'admin/sessions.html',
                        {
                            'user_id': request.session.get(
                                'user_id', 'Unknown'),
                            'cookie_size': cookie_size,
                            'max_cookie_size': max_cookie_size,
                        }
                    )

        tz = utils.get_timezone(request)
        if tz:
            timezone.activate(tz)
481471
def _make_request(self, request):
        
        # TODO: I'm sure all kinds of error checking needs to go here
        try:
            response_raw = urllib2.urlopen(request)
        except urllib2.HTTPError, e:
            print e.read()
            raise

        response_str = response_raw.read()
        response = json.loads(response_str)

        self._last_request = request
        self._last_response = response_raw
        self._last_response_str = response_str
        return response
740508
private void dumpRequest(final HttpServletRequestLoggingWrapper request, final int id) {
        final StringWriter stringWriter = new StringWriter();
        final PrintWriter printWriter = new PrintWriter(stringWriter);
        if ((request.getRemoteUser() == null) || (request.getRemoteUser().trim().length() == 0)) {
            printWriter.print("Not authenticated");
        } else {
            printWriter.print("Authenticated as ");
            printWriter.println(request.getRemoteUser());
        }
        printWriter.print("-- ID: ");
        printWriter.println(id);
        printWriter.print(request.getMethod());
        printWriter.print(" ");
        printWriter.print(request.getRequestURL());
        printWriter.print(" ");
        printWriter.println(request.getProtocol());
        if (LOG_HEADERS.isDebugEnabled()) {
            @SuppressWarnings("unchecked")
            final Enumeration<String> headerNames = request.getHeaderNames();
            while (headerNames.hasMoreElements()) {
                final String key = headerNames.nextElement();
                @SuppressWarnings("unchecked")
                final Enumeration<String> headerValues = request.getHeaders(key);
                printWriter.print(key);
                printWriter.print(": ");
                while (headerValues.hasMoreElements()) {
                    printWriter.print(headerValues.nextElement());
                    printWriter.println();
                    if (headerValues.hasMoreElements()) {
                        printWriter.print(' ');
                    }
                }
            }
        }
        printWriter.println("-- Begin request body");
        final String body = request.getBody();
        if (body == null || body.length() == 0) {
            printWriter.println("-- NO BODY FOUND IN REQUEST");
        } else {
            printWriter.println(body);
        }
        printWriter.println("-- End request body");
        printWriter.flush();
        LOG_REQUEST.debug(stringWriter.toString());
    }
331486
def get_log(self, request, response):
        
        return {
            'method': request.method,
            'path': request.get_full_path(),
            'code': response.status_code,
            'time': time.time(),
        }
1230902
def _before_request(self):
        
        g._request_id = str(uuid.uuid4())
        g._start_timestamp = time.time()
1345909
def request(self, request):
        
        if request is None:
            raise ValueError("Invalid value for `request`, must not be `None`")  # noqa: E501
        if request is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', request):  # noqa: E501
            raise ValueError(r"Invalid value for `request`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`")  # noqa: E501

        self._request = request