MCPcopy
hub / github.com/benoitc/gunicorn / log_request

Method log_request

gunicorn/workers/ggevent.py:160–174  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158class PyWSGIHandler(pywsgi.WSGIHandler):
159
160 def log_request(self):
161 start = datetime.fromtimestamp(self.time_start)
162 finish = datetime.fromtimestamp(self.time_finish)
163 response_time = finish - start
164 resp_headers = getattr(self, 'response_headers', {})
165
166 # Status is expected to be a string but is encoded to bytes in gevent for PY3
167 # Except when it isn't because gevent uses hardcoded strings for network errors.
168 status = self.status.decode() if isinstance(self.status, bytes) else self.status
169 resp = GeventResponse(status, resp_headers, self.response_length)
170 if hasattr(self, 'headers'):
171 req_headers = self.headers.items()
172 else:
173 req_headers = []
174 self.server.log.access(resp, req_headers, self.environ, response_time)
175
176 def get_environ(self):
177 env = super().get_environ()

Callers

nothing calls this directly

Calls 4

GeventResponseClass · 0.85
decodeMethod · 0.80
itemsMethod · 0.80
accessMethod · 0.45

Tested by

no test coverage detected