basehandler.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:dcos 作者: dcos 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号