google-cloud-debugger 0.32.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +23 -1
- data/lib/google/cloud/debugger.rb +33 -0
- data/lib/google/cloud/debugger/rails.rb +3 -1
- data/lib/google/cloud/debugger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b7ed1274bf5cea538b50035f9ce20d8dd442229cf891ab55feaac18af6e5bf0
|
4
|
+
data.tar.gz: a635a7b21556d84b9b1f4ce3809e0d6b4465ebb7a7d8371d38c62bb51479c800
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
##
|
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
|
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
|
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.
|
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
|
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
|