Module: Google::Cloud
- Defined in:
- lib/google-cloud-logging.rb,
lib/google/cloud/logging.rb,
lib/google/cloud/logging/sink.rb,
lib/google/cloud/logging/entry.rb,
lib/google/cloud/logging/logger.rb,
lib/google/cloud/logging/metric.rb,
lib/google/cloud/logging/project.rb,
lib/google/cloud/logging/service.rb,
lib/google/cloud/logging/version.rb,
lib/google/cloud/logging/resource.rb,
lib/google/cloud/logging/sink/list.rb,
lib/google/cloud/logging/entry/list.rb,
lib/google/cloud/logging/credentials.rb,
lib/google/cloud/logging/metric/list.rb,
lib/google/cloud/logging/entry/operation.rb,
lib/google/cloud/logging/entry/http_request.rb,
lib/google/cloud/logging/resource_descriptor.rb,
lib/google/cloud/logging/resource_descriptor/list.rb
Defined Under Namespace
Modules: Logging
Class Method Summary collapse
-
.logging(project = nil, keyfile = nil, scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Logging::Project
Creates a new object for connecting to the Stackdriver Logging service.
Instance Method Summary collapse
-
#logging(scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Logging::Project
Creates a new object for connecting to the Stackdriver Logging service.
Class Method Details
.logging(project = nil, keyfile = nil, scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Logging::Project
Creates a new object for connecting to the Stackdriver Logging service. Each call creates a new connection.
For more information on connecting to Google Cloud see the Authentication Guide.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/google-cloud-logging.rb', line 99 def self.logging project = nil, keyfile = nil, scope: nil, retries: nil, timeout: nil require "google/cloud/logging" project ||= Google::Cloud::Logging::Project.default_project project = project.to_s # Always cast to a string fail ArgumentError, "project is missing" if project.empty? if keyfile.nil? credentials = Google::Cloud::Logging::Credentials.default( scope: scope) else credentials = Google::Cloud::Logging::Credentials.new( keyfile, scope: scope) end Google::Cloud::Logging::Project.new( Google::Cloud::Logging::Service.new( project, credentials, retries: retries, timeout: timeout)) end |
Instance Method Details
#logging(scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Logging::Project
Creates a new object for connecting to the Stackdriver Logging service. Each call creates a new connection.
For more information on connecting to Google Cloud see the Authentication Guide.
61 62 63 64 65 |
# File 'lib/google-cloud-logging.rb', line 61 def logging scope: nil, retries: nil, timeout: nil Google::Cloud.logging @project, @keyfile, scope: scope, retries: (retries || @retries), timeout: (timeout || @timeout) end |