require"logger"moduleMyLoggerLOGGER=Logger.new$stderr,level:Logger::WARNdefloggerLOGGERendend# Define a gRPC module-level logger method before grpc/logconfig.rb loads.moduleGRPCextendMyLoggerend
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [2.13.0 (latest)](/ruby/docs/reference/google-cloud-datastore/latest/LOGGING)\n- [2.12.0](/ruby/docs/reference/google-cloud-datastore/2.12.0/LOGGING)\n- [2.11.0](/ruby/docs/reference/google-cloud-datastore/2.11.0/LOGGING)\n- [2.10.0](/ruby/docs/reference/google-cloud-datastore/2.10.0/LOGGING)\n- [2.9.0](/ruby/docs/reference/google-cloud-datastore/2.9.0/LOGGING)\n- [2.8.0](/ruby/docs/reference/google-cloud-datastore/2.8.0/LOGGING)\n- [2.7.1](/ruby/docs/reference/google-cloud-datastore/2.7.1/LOGGING)\n- [2.6.0](/ruby/docs/reference/google-cloud-datastore/2.6.0/LOGGING)\n- [2.5.0](/ruby/docs/reference/google-cloud-datastore/2.5.0/LOGGING)\n- [2.4.0](/ruby/docs/reference/google-cloud-datastore/2.4.0/LOGGING)\n- [2.3.1](/ruby/docs/reference/google-cloud-datastore/2.3.1/LOGGING)\n- [2.2.4](/ruby/docs/reference/google-cloud-datastore/2.2.4/LOGGING) \n\nEnabling gRPC Logging\n=====================\n\nTo enable logging for this library, set the logger for the underlying\n[gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger\nthat you set may be a Ruby stdlib\n[`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as\nshown below, or a\n[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)\nthat will write logs to [Stackdriver\nLogging](https://cloud.google.com/logging/). See\n[grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)\nand the gRPC\n[spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)\nfor additional information.\n\nConfiguring a Ruby stdlib logger: \n\n```ruby\nrequire \"logger\"\n\nmodule MyLogger\n LOGGER = Logger.new $stderr, level: Logger::WARN\n def logger\n LOGGER\n end\nend\n\n# Define a gRPC module-level logger method before grpc/logconfig.rb loads.\nmodule GRPC\n extend MyLogger\nend\n```"]]