File tree 2 files changed +12
-2
lines changed
gapic/templates/%namespace/%name_%version/%sub/services/%service/transports
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,9 @@ class {{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
259
259
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
260
260
resp, _ = self._interceptor.post_{{ method.name|snake_case }}_with_metadata(resp, response_metadata)
261
261
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER
262
- {# Logging of response iterator is in google-api-core #}
262
+ {# Logging of the streaming response payload is in `google-api-core` because the response #}
263
+ {# type `rest_streaming.ResponseIterator` is an iterator. #}
264
+ {# Each response 'item' is logged at the time that it is fetched which happens in google-api-core. #}
263
265
{% if not method .server_streaming %}
264
266
try:
265
267
response_payload = {% if method .output .ident .is_proto_plus_type %} {{ method.output.ident }}.to_json(response){% else %} json_format.MessageToJson(resp){% endif %}
@@ -269,6 +271,9 @@ class {{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
269
271
response_payload = None
270
272
{% endif %} {# if not method.server_streaming #}
271
273
http_response = {
274
+ {# Logging of the streaming response payload is in `google-api-core` because the response #}
275
+ {# type `rest_streaming.ResponseIterator` is an iterator. #}
276
+ {# Each response 'item' is logged at the time that it is fetched which happens in google-api-core. #}
272
277
{% if not method .server_streaming %}
273
278
"payload": response_payload,
274
279
{% endif %} {# if not method.server_streaming #}
Original file line number Diff line number Diff line change @@ -220,7 +220,9 @@ class Async{{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
220
220
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
221
221
resp, _ = await self._interceptor.post_{{ method.name|snake_case }}_with_metadata(resp, response_metadata)
222
222
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER
223
- {# Logging of response iterator is in google-api-core #}
223
+ {# Logging of the streaming response payload is in `google-api-core` because the response #}
224
+ {# type `rest_streaming_async.AsyncResponseIterator` is an iterator. #}
225
+ {# Each response 'item' is logged at the time that it is fetched which happens in google-api-core. #}
224
226
{% if not method .server_streaming %}
225
227
try:
226
228
response_payload = {% if method .output .ident .is_proto_plus_type %} {{ method.output.ident }}.to_json(response){% else %} json_format.MessageToJson(resp){% endif %}
@@ -230,6 +232,9 @@ class Async{{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
230
232
response_payload = None
231
233
{% endif %} {# if not method.server_streaming #}
232
234
http_response = {
235
+ {# Logging of the streaming response payload is in `google-api-core` because the response #}
236
+ {# type `rest_streaming_async.AsyncResponseIterator` is an iterator. #}
237
+ {# Each response 'item' is logged at the time that it is fetched which happens in google-api-core. #}
233
238
{% if not method .server_streaming %}
234
239
"payload": response_payload,
235
240
{% endif %} {# if not method.server_streaming #}
You can’t perform that action at this time.
0 commit comments