def log_message(self, log_format, *args):
"""Just a patch to make Mockers Requests Handlers compatible with
Unix Sockets.
Method logs the request without source IP address/with hard-coded value
of `unix-socket-connection` if the socket is a Unix Socket.
Please check the http.server.BaseHTTPRequestHandler documentation
for the meaning of the function arguments.
"""
endpoint_id = self.server.context.data['endpoint_id']
if self.server.address_family == socket.AF_UNIX:
log.debug("[Endpoint: %s] %s - - [%s] %s\n",
endpoint_id,
"unix-socket-connection",
self.log_date_time_string(),
log_format % args)
else:
log.debug("[Endpoint: %s] %s - - [%s] %s\n",
endpoint_id,
self.address_string(),
self.log_date_time_string(),
log_format % args)
评论列表
文章目录