#NEWLINE# @ staticmethod #NEWLINE# def log_http_response( resp ) : #NEWLINE# #INDENT# status = ( ( resp . raw . version / 10.0 ) , resp . status_code , resp . reason ) #NEWLINE# dump = [ ( '\nHTTP/%.1f %s %s' % status ) ] #NEWLINE# dump . extend ( [ ( '%s: %s' % ( k , v ) ) for ( k , v ) in resp . headers . items ( ) ] ) #NEWLINE# dump . append ( '' ) #NEWLINE# if resp . content : #NEWLINE# #INDENT# content = resp . content #NEWLINE# if isinstance ( content , six . binary_type ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# content = encodeutils . safe_decode ( status . content ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dump . extend ( [ content , '' ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# LOG . debug ( '\n' . join ( dump ) )