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: 74bb3c2a1f4a5a750b1c6879afc7539c0648a942bca0835cbe5cfa16cccea7f8
4
- data.tar.gz: f95a3897eb396963d49c279ec8df360514b01477fb45918f8ff1855df0645001
3
+ metadata.gz: 0c4364ae0366f10cd54af70bfe275f3e6416d6b03c4aebe8c65e46396152f89f
4
+ data.tar.gz: 235fe8d2d14da9de75fd949d4d7e43414a8bc2b1dc14e7e2f6f0083a0b1aed48
5
5
  SHA512:
6
- metadata.gz: f901b1191fd5df3d049e39f52a12172a07fa923d38dfbef3fe7a2ffc9db2d0d8ac874af782d349fb5091ee06eacb947e465fac43acb3e4ae07b844f3bb89e60f
7
- data.tar.gz: 2a93ebd65b37fc124774d1f193996fa46de73f1570bd53629210d3b60e9f2ff08def09cc5feccc1ca18882fe420615bcfa54abdaaf058976c9bd159aba9c4b86
6
+ metadata.gz: 71ba0bd59b1ef7243a1310995045d607b9f7e19c096e38d92b1211ca7b8598e8673bce1d370e447643113947dfb84372c8c16c4b1b4a55a7f423ae3799c0ba1d
7
+ data.tar.gz: 062d8a386fe74ff109c4b8cef5010361319b9c97f7b332b059e1e485d44f098a7a53a2bc6ba73615ceb5aaf15dcbe9aeed837535231f9e0c513e6b0d7fa93293
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- google_cloud_logging_extension (0.1.3)
4
+ google_cloud_logging_extension (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoogleCloudLoggingExtension
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_cloud_logging_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ishotihadus