google-cloud-debugger 0.32.0 → 0.32.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 192b49269ab919dffd129a0ec48af66cdab93f4c83cf4e502e14dfedeceaab80
4
- data.tar.gz: 0c88a6443ae79182cee72c5cff5c6fc2fc0641fe1424ec30fba0d498c653f508
3
+ metadata.gz: 9b7ed1274bf5cea538b50035f9ce20d8dd442229cf891ab55feaac18af6e5bf0
4
+ data.tar.gz: a635a7b21556d84b9b1f4ce3809e0d6b4465ebb7a7d8371d38c62bb51479c800
5
5
  SHA512:
6
- metadata.gz: 876816208a7431ec0201a85cdf5ff1c861a2b7fa7f2beb64be8ae96224b00ddcdcbb9de1b92d0c47970b0f0ac83c82edbfec3c93edb8344d1b9667340b7d6791
7
- data.tar.gz: aae912a8b8d3d6a6133a3731bf0c5aa6c8c3b4d82a2c7c8840f76d779477d9365fbad56f5bec27a15adb455ca33c6b49f56a0aec4ebd5169e79fb102c7a5cafb
6
+ metadata.gz: df72382f398676edfc3703ac5294b21f1db461f8e80d104d9afe63cfa86aea1b686e94f5b9e9f8aaa14f826a0719c96d2618d6cc65560f56370d04cf9220c827
7
+ data.tar.gz: ab85c6aa805fb1b884b49a887ad3f2ffa3ed2ed7666cdff9e997de886e8b1a06e52dc4dcbee8c808e21bb8acf62c6f83f253835b327841c283bd9e6d72247dcd
data/README.md CHANGED
@@ -222,7 +222,29 @@ behavior of the debugger itself, such as side effect protection and data
222
222
  size limits. See [agent configuration](../stackdriver/docs/configuration.md)
223
223
  for a list of possible configuration options.
224
224
 
225
- ## Compatibility
225
+ ## Enabling Logging
226
+
227
+ To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger) that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
228
+
229
+ Configuring a Ruby stdlib logger:
230
+
231
+ ```ruby
232
+ require "logger"
233
+
234
+ module MyLogger
235
+ LOGGER = Logger.new $stderr, level: Logger::WARN
236
+ def logger
237
+ LOGGER
238
+ end
239
+ end
240
+
241
+ # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
242
+ module GRPC
243
+ extend MyLogger
244
+ end
245
+ ```
246
+
247
+ ## Supported Ruby Versions
226
248
 
227
249
  This library is supported on Ruby 2.2 or later.
228
250
 
@@ -321,6 +321,39 @@ module Google
321
321
  #
322
322
  # See {Google::Cloud::Debugger::V2::Debugger2Client} for details.
323
323
  #
324
+ # ## Enabling Logging
325
+ #
326
+ # To enable logging for this library, set the logger for the underlying
327
+ # [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The
328
+ # logger that you set may be a Ruby stdlib
329
+ # [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html)
330
+ # as shown below, or a
331
+ # [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
332
+ # that will write logs to [Stackdriver
333
+ # Logging](https://cloud.google.com/logging/). See
334
+ # [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
335
+ # and the gRPC
336
+ # [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)
337
+ # for additional information.
338
+ #
339
+ # Configuring a Ruby stdlib logger:
340
+ #
341
+ # ```ruby
342
+ # require "logger"
343
+ #
344
+ # module MyLogger
345
+ # LOGGER = Logger.new $stderr, level: Logger::WARN
346
+ # def logger
347
+ # LOGGER
348
+ # end
349
+ # end
350
+ #
351
+ # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
352
+ # module GRPC
353
+ # extend MyLogger
354
+ # end
355
+ # ```
356
+ #
324
357
  module Debugger
325
358
  # rubocop:disable all
326
359
 
@@ -108,7 +108,9 @@ module Google
108
108
  gcp_config = rails_config.google_cloud
109
109
  dbg_config = gcp_config.debugger
110
110
 
111
- Cloud.configure.use_debugger ||= gcp_config.use_debugger
111
+ if Cloud.configure.use_debugger.nil?
112
+ Cloud.configure.use_debugger = gcp_config.use_debugger
113
+ end
112
114
  Debugger.configure do |config|
113
115
  config.project_id ||= begin
114
116
  config.project || dbg_config.project_id || dbg_config.project
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Debugger
19
- VERSION = "0.32.0".freeze
19
+ VERSION = "0.32.1".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-debugger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.0
4
+ version: 0.32.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heng Xiong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller