lib/google/cloud/storage.rb in google-cloud-storage-1.12.0 vs lib/google/cloud/storage.rb in google-cloud-storage-1.13.0
- old
+ new
@@ -56,9 +56,37 @@
#
# To learn more about Cloud Storage, read the
# [Google Cloud Storage Overview
# ](https://cloud.google.com/storage/docs/overview).
#
+ # ## Enabling Logging
+ #
+ # To enable logging for this library, set the logger for the underlying
+ # [Google API Client](https://github.com/google/google-api-ruby-client/blob/master/README.md#logging)
+ # library. The logger that you set may be a Ruby stdlib
+ # [`Logger`](https://ruby-doc.org/stdlib-2.4.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/).
+ #
+ # If you do not set the logger explicitly and your application is running in
+ # a Rails environment, it will default to `Rails.logger`. Otherwise, if you
+ # do not set the logger and you are not using Rails, logging is disabled by
+ # default.
+ #
+ # Configuring a Ruby stdlib logger:
+ #
+ # ```ruby
+ # require "logger"
+ #
+ # my_logger = Logger.new $stderr
+ # my_logger.level = Logger::WARN
+ #
+ # # Set the Google API Client logger
+ # Google::Apis.logger = my_logger
+ # ```
+ #
# ## Retrieving Buckets
#
# A {Google::Cloud::Storage::Bucket} instance is a container for your data.
# There is no limit on the number of buckets that you can create in a
# project. You can use buckets to organize and control access to your data.