google_cloud_logging_extension 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c4364ae0366f10cd54af70bfe275f3e6416d6b03c4aebe8c65e46396152f89f
|
4
|
+
data.tar.gz: 235fe8d2d14da9de75fd949d4d7e43414a8bc2b1dc14e7e2f6f0083a0b1aed48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71ba0bd59b1ef7243a1310995045d607b9f7e19c096e38d92b1211ca7b8598e8673bce1d370e447643113947dfb84372c8c16c4b1b4a55a7f423ae3799c0ba1d
|
7
|
+
data.tar.gz: 062d8a386fe74ff109c4b8cef5010361319b9c97f7b332b059e1e485d44f098a7a53a2bc6ba73615ceb5aaf15dcbe9aeed837535231f9e0c513e6b0d7fa93293
|
data/Gemfile.lock
CHANGED
@@ -33,6 +33,8 @@ module Google
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
DEFAULT_REDIRECTS = []
|
37
|
+
|
36
38
|
def self.create(log_name, resource_type = 'gce_project', **labels)
|
37
39
|
logging = Google::Cloud::Logging.new
|
38
40
|
writer = logging.async_writer(max_queue_size: 1000)
|
@@ -44,14 +46,21 @@ module Google
|
|
44
46
|
if labels.key?(:redirects)
|
45
47
|
redirects = labels[:redirects]
|
46
48
|
labels.delete(:redirects)
|
49
|
+
redirects = [redirects] unless redirects.is_a?(Array)
|
50
|
+
redirects.compact!
|
51
|
+
end
|
52
|
+
unless DEFAULT_REDIRECTS.empty?
|
53
|
+
if redirects
|
54
|
+
redirects += DEFAULT_REDIRECTS
|
55
|
+
else
|
56
|
+
redirects = DEFAULT_REDIRECTS.dup
|
57
|
+
end
|
47
58
|
end
|
59
|
+
|
48
60
|
logger = Google::Cloud::Logging::Logger.new(writer, log_name, resource, labels)
|
49
61
|
logger.level = level if level
|
50
62
|
|
51
63
|
if redirects
|
52
|
-
redirects = [redirects] unless redirects.is_a?(Array)
|
53
|
-
redirects.compact!
|
54
|
-
|
55
64
|
redirects.map! do |e|
|
56
65
|
case e
|
57
66
|
when :stdout
|