lib/google/cloud/video/transcoder/v1/transcoder_service/rest/client.rb in google-cloud-video-transcoder-v1-1.0.1 vs lib/google/cloud/video/transcoder/v1/transcoder_service/rest/client.rb in google-cloud-video-transcoder-v1-1.1.0

- old
+ new

@@ -175,14 +175,34 @@ @transcoder_service_stub = ::Google::Cloud::Video::Transcoder::V1::TranscoderService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, - credentials: credentials + credentials: credentials, + logger: @config.logger ) + + @transcoder_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end end + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @transcoder_service_stub.logger + end + # Service calls ## # Creates a job in the specified region. # @@ -257,11 +277,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.create_job request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -351,11 +370,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.list_jobs request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -431,11 +449,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.get_job request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -514,11 +531,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.delete_job request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -602,11 +618,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.create_job_template request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -697,11 +712,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.list_job_templates request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -778,11 +792,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.get_job_template request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -861,11 +874,10 @@ metadata: @config.metadata, retry_policy: @config.retry_policy @transcoder_service_stub.delete_job_template request, options do |result, operation| yield result, operation if block_given? - return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end @@ -941,10 +953,15 @@ # @!attribute [rw] universe_domain # The universe domain within which to make requests. This determines the # default endpoint URL. The default value of nil uses the environment # universe (usually the default "googleapis.com" universe). # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] # class Configuration extend ::Gapic::Config # @private @@ -962,9 +979,10 @@ config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil?