@@ -50,8 +50,11 @@ def _send_request(self, request, headers=None, content=None, **operation_config)
50
50
"""
51
51
if TRACE_ENV_VAR in os .environ and os .environ [TRACE_ENV_VAR ] == 'true' :
52
52
print (request .method + ' ' + request .url )
53
+ logging .debug ('%s %s' , request .method , request .url )
54
+ logging .debug ('Request content: %s' , content )
53
55
response = self ._client .send (request = request , headers = headers ,
54
56
content = content , ** operation_config )
57
+ logging .debug ('Response content: %s' , response .content )
55
58
if response .status_code < 200 or response .status_code >= 300 :
56
59
self ._handle_error (request , response )
57
60
return response
@@ -66,6 +69,14 @@ def _send(self, http_method, location_id, version, route_values=None,
66
69
negotiated_version = self ._negotiate_request_version (
67
70
self ._get_resource_location (location_id ),
68
71
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
+
69
80
# Construct headers
70
81
headers = {'Content-Type' : media_type + '; charset=utf-8' ,
71
82
'Accept' : 'application/json;api-version=' + negotiated_version }
@@ -139,14 +150,14 @@ def _get_resource_locations(self, all_host_types):
139
150
# Next check for options cached on disk
140
151
if not all_host_types and OPTIONS_FILE_CACHE [self .normalized_url ]:
141
152
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 )
143
154
self ._locations = self ._base_deserialize .deserialize_data (OPTIONS_FILE_CACHE [self .normalized_url ],
144
155
'[ApiResourceLocation]' )
145
156
return self ._locations
146
157
except DeserializationError as ex :
147
158
logging .exception (str (ex ))
148
159
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 )
150
161
151
162
# Last resort, make the call to the server
152
163
options_uri = self ._combine_url (self .config .base_url , '_apis' )
0 commit comments