@@ -50,8 +50,11 @@ def _send_request(self, request, headers=None, content=None, **operation_config)
5050 """
5151 if TRACE_ENV_VAR in os .environ and os .environ [TRACE_ENV_VAR ] == 'true' :
5252 print (request .method + ' ' + request .url )
53+ logging .debug ('%s %s' , request .method , request .url )
54+ logging .debug ('Request content: %s' , content )
5355 response = self ._client .send (request = request , headers = headers ,
5456 content = content , ** operation_config )
57+ logging .debug ('Response content: %s' , response .content )
5558 if response .status_code < 200 or response .status_code >= 300 :
5659 self ._handle_error (request , response )
5760 return response
@@ -66,6 +69,14 @@ def _send(self, http_method, location_id, version, route_values=None,
6669 negotiated_version = self ._negotiate_request_version (
6770 self ._get_resource_location (location_id ),
6871 version )
72+
73+ if version != negotiated_version :
74+ logging .info ("Negotiated api version from '%s' down to '%s'. This means the client is newer than the server." ,
75+ version ,
76+ negotiated_version )
77+ else :
78+ logging .debug ("Api version '%s'" , negotiated_version )
79+
6980 # Construct headers
7081 headers = {'Content-Type' : media_type + '; charset=utf-8' ,
7182 'Accept' : 'application/json;api-version=' + negotiated_version }
@@ -139,14 +150,14 @@ def _get_resource_locations(self, all_host_types):
139150 # Next check for options cached on disk
140151 if not all_host_types and OPTIONS_FILE_CACHE [self .normalized_url ]:
141152 try :
142- logging .info ('File cache hit for options on: %s' , self .normalized_url )
153+ logging .debug ('File cache hit for options on: %s' , self .normalized_url )
143154 self ._locations = self ._base_deserialize .deserialize_data (OPTIONS_FILE_CACHE [self .normalized_url ],
144155 '[ApiResourceLocation]' )
145156 return self ._locations
146157 except DeserializationError as ex :
147158 logging .exception (str (ex ))
148159 else :
149- logging .info ('File cache miss for options on: %s' , self .normalized_url )
160+ logging .debug ('File cache miss for options on: %s' , self .normalized_url )
150161
151162 # Last resort, make the call to the server
152163 options_uri = self ._combine_url (self .config .base_url , '_apis' )
0 commit comments