(self)
| 158 | class 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() |
nothing calls this directly
no test coverage detected