google-cloud-logging 2.7.0 → 2.8.0
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/CHANGELOG.md +12 -0
- data/lib/google/cloud/logging/middleware.rb +10 -2
- data/lib/google/cloud/logging/project.rb +9 -0
- data/lib/google/cloud/logging/rails.rb +8 -2
- data/lib/google/cloud/logging/service.rb +14 -1
- data/lib/google/cloud/logging/version.rb +1 -1
- data/lib/google/cloud/logging.rb +16 -6
- data/lib/google-cloud-logging.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62cb44a5ea5845e08c87173069eff5ee70b6a72e9400f965a6bf9c23f77035d9
|
|
4
|
+
data.tar.gz: 2cfdddf3c43de146a4c4c099a058b1ab22cad84f1ddf2f1897c7a449f3ec3d64
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22a0de7d8c5aa20ef38c480ce0e104508f53541fe7d890c75026af89e3a6ceb386e07b093ebabbceac2a10c48d08c6631dc0f4b6765a8b230f3f1de6b387475c
|
|
7
|
+
data.tar.gz: c2bc64ac5c8b299405f6413b1cfec1733f9ea6369c2856392fab40002f049363fa3fe49395f6d980d416daeb8ce8b5e662379032e3f5b4745468bef6c2008722
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
### 2.8.0 (2026-12-02)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* Universe domain support ([#36736](https://github.com/googleapis/google-cloud-ruby/issues/36736))
|
|
8
|
+
|
|
9
|
+
### 2.7.1 (2026-10-29)
|
|
10
|
+
|
|
11
|
+
#### Documentation
|
|
12
|
+
|
|
13
|
+
* link to the published Ruby version support policy ([#36660](https://github.com/googleapis/google-cloud-ruby/issues/36660))
|
|
14
|
+
|
|
3
15
|
### 2.7.0 (2026-04-15)
|
|
4
16
|
|
|
5
17
|
#### Features
|
|
@@ -62,8 +62,10 @@ module Google
|
|
|
62
62
|
logger ||= Middleware.logger
|
|
63
63
|
logger ||= begin
|
|
64
64
|
log_name = configuration.log_name
|
|
65
|
-
logging = Logging.new project_id:
|
|
66
|
-
credentials:
|
|
65
|
+
logging = Logging.new project_id: configuration.project_id,
|
|
66
|
+
credentials: configuration.credentials,
|
|
67
|
+
endpoint: configuration.endpoint,
|
|
68
|
+
universe_domain: configuration.universe_domain
|
|
67
69
|
resource = Middleware.build_monitored_resource(
|
|
68
70
|
configuration.monitored_resource.type,
|
|
69
71
|
configuration.monitored_resource.labels
|
|
@@ -279,6 +281,12 @@ module Google
|
|
|
279
281
|
creds = kwargs[:credentials] || kwargs[:keyfile]
|
|
280
282
|
configuration.credentials = creds unless creds.nil?
|
|
281
283
|
|
|
284
|
+
endpoint = kwargs[:endpoint]
|
|
285
|
+
configuration.endpoint = endpoint unless endpoint.nil?
|
|
286
|
+
|
|
287
|
+
universe_domain = kwargs[:universe_domain]
|
|
288
|
+
configuration.universe_domain = universe_domain unless universe_domain.nil?
|
|
289
|
+
|
|
282
290
|
log_name_map = kwargs[:log_name_map]
|
|
283
291
|
configuration.log_name_map = log_name_map unless log_name_map.nil?
|
|
284
292
|
|
|
@@ -76,6 +76,15 @@ module Google
|
|
|
76
76
|
end
|
|
77
77
|
alias project project_id
|
|
78
78
|
|
|
79
|
+
##
|
|
80
|
+
# The universe domain the client is connected to.
|
|
81
|
+
#
|
|
82
|
+
# @return [String]
|
|
83
|
+
#
|
|
84
|
+
def universe_domain
|
|
85
|
+
service.universe_domain
|
|
86
|
+
end
|
|
87
|
+
|
|
79
88
|
##
|
|
80
89
|
# Lists log entries. Use this method to retrieve log entries from Cloud
|
|
81
90
|
# Logging.
|
|
@@ -65,13 +65,17 @@ module Google
|
|
|
65
65
|
def self.init_middleware app
|
|
66
66
|
project_id = Logging.configure.project_id
|
|
67
67
|
credentials = Logging.configure.credentials
|
|
68
|
+
endpoint = Logging.configure.endpoint
|
|
69
|
+
universe_domain = Logging.configure.universe_domain
|
|
68
70
|
resource_type = Logging.configure.monitored_resource.type
|
|
69
71
|
resource_labels = Logging.configure.monitored_resource.labels
|
|
70
72
|
log_name = Logging.configure.log_name
|
|
71
73
|
labels = Logging.configure.labels
|
|
72
74
|
|
|
73
|
-
logging = Google::Cloud::Logging.new project_id:
|
|
74
|
-
credentials:
|
|
75
|
+
logging = Google::Cloud::Logging.new project_id: project_id,
|
|
76
|
+
credentials: credentials,
|
|
77
|
+
endpoint: endpoint,
|
|
78
|
+
universe_domain: universe_domain
|
|
75
79
|
resource =
|
|
76
80
|
Logging::Middleware.build_monitored_resource resource_type,
|
|
77
81
|
resource_labels
|
|
@@ -172,6 +176,8 @@ module Google
|
|
|
172
176
|
config.credentials ||= config.keyfile
|
|
173
177
|
config.credentials ||= log_config.credentials || log_config.keyfile
|
|
174
178
|
config.credentials ||= gcp_config.credentials || gcp_config.keyfile
|
|
179
|
+
config.endpoint ||= log_config.endpoint
|
|
180
|
+
config.universe_domain ||= log_config.universe_domain || gcp_config.universe_domain
|
|
175
181
|
config.log_name ||= log_config.log_name
|
|
176
182
|
config.labels ||= log_config.labels
|
|
177
183
|
config.log_name_map ||= log_config.log_name_map
|
|
@@ -32,11 +32,21 @@ module Google
|
|
|
32
32
|
|
|
33
33
|
##
|
|
34
34
|
# Creates a new Service instance.
|
|
35
|
-
def initialize project, credentials, timeout: nil, host: nil
|
|
35
|
+
def initialize project, credentials, timeout: nil, host: nil, universe_domain: nil
|
|
36
36
|
@project = project
|
|
37
37
|
@credentials = credentials
|
|
38
38
|
@timeout = timeout
|
|
39
39
|
@host = host
|
|
40
|
+
@universe_domain = universe_domain
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def universe_domain
|
|
44
|
+
@logging&.universe_domain ||
|
|
45
|
+
@universe_domain ||
|
|
46
|
+
V2::LoggingService::Client.configure.universe_domain ||
|
|
47
|
+
Google::Cloud.configure.logging.universe_domain ||
|
|
48
|
+
ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"] ||
|
|
49
|
+
"googleapis.com"
|
|
40
50
|
end
|
|
41
51
|
|
|
42
52
|
def logging
|
|
@@ -46,6 +56,7 @@ module Google
|
|
|
46
56
|
config.credentials = credentials if credentials
|
|
47
57
|
config.timeout = timeout if timeout
|
|
48
58
|
config.endpoint = host if host
|
|
59
|
+
config.universe_domain = @universe_domain if @universe_domain
|
|
49
60
|
config.lib_name = "gccl"
|
|
50
61
|
config.lib_version = Google::Cloud::Logging::VERSION
|
|
51
62
|
config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" }
|
|
@@ -60,6 +71,7 @@ module Google
|
|
|
60
71
|
config.credentials = credentials if credentials
|
|
61
72
|
config.timeout = timeout if timeout
|
|
62
73
|
config.endpoint = host if host
|
|
74
|
+
config.universe_domain = @universe_domain if @universe_domain
|
|
63
75
|
config.lib_name = "gccl"
|
|
64
76
|
config.lib_version = Google::Cloud::Logging::VERSION
|
|
65
77
|
config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" }
|
|
@@ -74,6 +86,7 @@ module Google
|
|
|
74
86
|
config.credentials = credentials if credentials
|
|
75
87
|
config.timeout = timeout if timeout
|
|
76
88
|
config.endpoint = host if host
|
|
89
|
+
config.universe_domain = @universe_domain if @universe_domain
|
|
77
90
|
config.lib_name = "gccl"
|
|
78
91
|
config.lib_version = Google::Cloud::Logging::VERSION
|
|
79
92
|
config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" }
|
data/lib/google/cloud/logging.rb
CHANGED
|
@@ -83,6 +83,9 @@ module Google
|
|
|
83
83
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
|
84
84
|
# @param [String] endpoint Override of the endpoint host name. Optional.
|
|
85
85
|
# If the param is nil, uses the default endpoint.
|
|
86
|
+
# @param [String] universe_domain Override of the universe domain. Optional.
|
|
87
|
+
# If the param is nil, uses the configured `universe_domain`,
|
|
88
|
+
# `ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"]`, or `"googleapis.com"`.
|
|
86
89
|
# @param [String] project Alias for the `project_id` argument. Deprecated.
|
|
87
90
|
# @param [String] keyfile Alias for the `credentials` argument.
|
|
88
91
|
# Deprecated.
|
|
@@ -104,13 +107,15 @@ module Google
|
|
|
104
107
|
scope: nil,
|
|
105
108
|
timeout: nil,
|
|
106
109
|
endpoint: nil,
|
|
110
|
+
universe_domain: nil,
|
|
107
111
|
project: nil,
|
|
108
112
|
keyfile: nil
|
|
109
|
-
project_id
|
|
110
|
-
scope
|
|
111
|
-
timeout
|
|
112
|
-
endpoint
|
|
113
|
-
|
|
113
|
+
project_id ||= project || default_project_id
|
|
114
|
+
scope ||= configure.scope
|
|
115
|
+
timeout ||= configure.timeout
|
|
116
|
+
endpoint ||= configure.endpoint
|
|
117
|
+
universe_domain ||= configure.universe_domain
|
|
118
|
+
credentials ||= keyfile || default_credentials(scope: scope)
|
|
114
119
|
|
|
115
120
|
unless credentials.is_a? Google::Auth::Credentials
|
|
116
121
|
credentials = Logging::Credentials.new credentials, scope: scope
|
|
@@ -122,7 +127,9 @@ module Google
|
|
|
122
127
|
project_id = project_id.to_s # Always cast to a string
|
|
123
128
|
raise ArgumentError, "project_id is missing" if project_id.empty?
|
|
124
129
|
|
|
125
|
-
service = Logging::Service.new project_id, credentials,
|
|
130
|
+
service = Logging::Service.new project_id, credentials,
|
|
131
|
+
host: endpoint, timeout: timeout,
|
|
132
|
+
universe_domain: universe_domain
|
|
126
133
|
Logging::Project.new service
|
|
127
134
|
end
|
|
128
135
|
|
|
@@ -147,6 +154,9 @@ module Google
|
|
|
147
154
|
# * `timeout` - (Integer) Default timeout to use in requests.
|
|
148
155
|
# * `endpoint` - (String) Override of the endpoint host name, or `nil`
|
|
149
156
|
# to use the default endpoint.
|
|
157
|
+
# * `universe_domain` - (String) Override of the universe domain, or
|
|
158
|
+
# `nil` to use `ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"]` or the default
|
|
159
|
+
# universe domain (`"googleapis.com"`).
|
|
150
160
|
# * `log_name` - (String) Name of the application log file. Default:
|
|
151
161
|
# `"ruby_app_log"`
|
|
152
162
|
# * `log_name_map` - (Hash) Map specific request routes to other log.
|
data/lib/google-cloud-logging.rb
CHANGED
|
@@ -165,7 +165,8 @@ Google::Cloud.configure.add_config! :logging do |config|
|
|
|
165
165
|
config.add_field! :scope, default_scopes, match: [String, Array]
|
|
166
166
|
config.add_field! :quota_project, nil, match: String
|
|
167
167
|
config.add_field! :timeout, nil, match: Integer
|
|
168
|
-
config.add_field! :endpoint,
|
|
168
|
+
config.add_field! :endpoint, nil, match: String, allow_nil: true
|
|
169
|
+
config.add_field! :universe_domain, nil, match: String, allow_nil: true
|
|
169
170
|
config.add_field! :log_name, nil, match: String
|
|
170
171
|
config.add_field! :log_name_map, nil, match: Hash
|
|
171
172
|
config.add_field! :labels, nil, match: Hash
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-cloud-logging
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Moore
|
|
@@ -30,7 +30,7 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 0.12.0
|
|
34
34
|
- - "<"
|
|
35
35
|
- !ruby/object:Gem::Version
|
|
36
36
|
version: 2.a
|
|
@@ -40,7 +40,7 @@ dependencies:
|
|
|
40
40
|
requirements:
|
|
41
41
|
- - ">="
|
|
42
42
|
- !ruby/object:Gem::Version
|
|
43
|
-
version:
|
|
43
|
+
version: 0.12.0
|
|
44
44
|
- - "<"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
46
|
version: 2.a
|