get a HTTP[S]Connection. Override when a custom connection is required, for example if there is a proxy.
(self, host, secure)
| 1279 | return record.__dict__ |
| 1280 | |
| 1281 | def getConnection(self, host, secure): |
| 1282 | """ |
| 1283 | get a HTTP[S]Connection. |
| 1284 | |
| 1285 | Override when a custom connection is required, for example if |
| 1286 | there is a proxy. |
| 1287 | """ |
| 1288 | import http.client |
| 1289 | if secure: |
| 1290 | connection = http.client.HTTPSConnection(host, context=self.context) |
| 1291 | else: |
| 1292 | connection = http.client.HTTPConnection(host) |
| 1293 | return connection |
| 1294 | |
| 1295 | def emit(self, record): |
| 1296 | """ |