def log(self, url, domain, method, response, tb_list, duration):
    'Log request, store traceback/response data and update counts.'
    if self.server_port:
        self._post({'url': url, 'domain': domain, 'method': method, 'response_content': str(response.content), 'response_status_code': response.status_code, 'duration': duration, 'traceback_list': tb_list})
    else:
        if (url not in self.logged_requests):
            self.logged_requests[url] = {'count': 0, 'methods': set(), 'tracebacks': set(), 'responses': set()}
        self.logged_requests[url]['count'] += 1
        self.logged_requests[url]['methods'].add(method)
        self.logged_requests[url]['tracebacks'].add(tuple(tb_list))
        self.logged_requests[url]['responses'].add((response.status_code, response.content))
        self.analysis['duration'] += duration
        self.analysis['total_requests'] += 1
        self.analysis['domains'].add(domain)
Log request, store traceback/response data and update counts.
def log(self, url, domain, method, response, tb_list, duration):
    
    if self.server_port:
        self._post({'url': url, 'domain': domain, 'method': method, 'response_content': str(response.content), 'response_status_code': response.status_code, 'duration': duration, 'traceback_list': tb_list})
    else:
        if (url not in self.logged_requests):
            self.logged_requests[url] = {'count': 0, 'methods': set(), 'tracebacks': set(), 'responses': set()}
        self.logged_requests[url]['count'] += 1
        self.logged_requests[url]['methods'].add(method)
        self.logged_requests[url]['tracebacks'].add(tuple(tb_list))
        self.logged_requests[url]['responses'].add((response.status_code, response.content))
        self.analysis['duration'] += duration
        self.analysis['total_requests'] += 1
        self.analysis['domains'].add(domain)