testa_logger 0.1.2 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b246a8edd93504bfcfaaec61ddfbf9c06bddd1dc58624af614dbfdb81fdaeda8
4
- data.tar.gz: c71b59ea05f9688a0c055fafc4ebddb110e51aabaeb3b6559385923bcabb8c2b
3
+ metadata.gz: 8e263591017a40fa1025680d2892df0cd9742257688b16b87019b3469ac2004e
4
+ data.tar.gz: 167d0cb8e46cf17821ee3876de61b29dd57561d7e47d01e5708d82396971f5ca
5
5
  SHA512:
6
- metadata.gz: c265670fda3e2fd39bd62e8c25d02ee13ee1acfdc9cf9754f464a04b7138891078d35db344d6b69cf7ad0c13aaa295bfdde6d4ba3aa627cd469b0b151bf85190
7
- data.tar.gz: 479851b409debb4e1e72004212bd56646ebc53ccd0cc8223d2cc26cc5e9cd473839ff1b339c66463a5e22b53296a425576c5e1556921bdf69fcddbe56e626ed5
6
+ metadata.gz: 4b250e6493e75951cb8d17ce82fb14980f95bd9828cc015a7e68b947cf7fcaee431d524efe1c63204a46121605671a3742334d2b4705ccce3c3f0a194e0477c3
7
+ data.tar.gz: 181c809692e98f2d8e3fa07f888aedb59b387399b5dc4c117b923553b0d46cc20b443f7273b04130cabf6ed54affff5198afdff00724ed73f7aee5fbdca1b7ec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testa_logger (0.1.1)
4
+ testa_logger (0.1.5)
5
5
  activesupport
6
6
  awesome_print
7
7
  aws-sdk-s3
@@ -47,7 +47,7 @@ module TestaLogger
47
47
 
48
48
  # stop writing into log file with it is being attached, otherwise checksum integrity will fail.
49
49
  response = @s3.put_object(
50
- bucket: options.s3_creds[:bucket],
50
+ bucket: options.s3_creds[:bucket_name],
51
51
  key: key,
52
52
  body: IO.read(options.filepath)
53
53
  )
@@ -114,6 +114,81 @@ module TestaLogger
114
114
  add_log_to_queue(UNKNOWN, tag, args, &block)
115
115
  end
116
116
 
117
+ def level=(severity)
118
+ if severity.is_a?(Integer)
119
+ @level = severity
120
+ else
121
+ SEV_LABEL.index(severity.to_s.downcase.upcase).to_i
122
+ end
123
+ end
124
+
125
+ # Returns +true+ iff the current severity level allows for the printing of
126
+ # +DEBUG+ messages.
127
+ def debug?
128
+ options.level <= DEBUG
129
+ end
130
+
131
+ # Sets the severity to DEBUG.
132
+ def debug!
133
+ options.level = DEBUG
134
+ end
135
+
136
+ # Returns +true+ iff the current severity level allows for the printing of
137
+ # +INFO+ messages.
138
+ def info?
139
+ options.level <= INFO
140
+ end
141
+
142
+ # Sets the severity to INFO.
143
+ def info!
144
+ options.level = INFO
145
+ end
146
+
147
+ # Returns +true+ iff the current severity level allows for the printing of
148
+ # +WARN+ messages.
149
+ def warn?
150
+ options.level <= WARN
151
+ end
152
+
153
+ # Sets the severity to WARN.
154
+ def warn!
155
+ options.level = WARN
156
+ end
157
+
158
+ # Returns +true+ iff the current severity level allows for the printing of
159
+ # +ERROR+ messages.
160
+ def error?
161
+ options.level <= ERROR
162
+ end
163
+
164
+ # Sets the severity to ERROR.
165
+ def error!
166
+ options.level = ERROR
167
+ end
168
+
169
+ # Returns +true+ iff the current severity level allows for the printing of
170
+ # +FATAL+ messages.
171
+ def fatal?
172
+ options.level <= FATAL
173
+ end
174
+
175
+ # Sets the severity to FATAL.
176
+ def fatal!
177
+ options.level = FATAL
178
+ end
179
+
180
+ def level
181
+ options.level
182
+ end
183
+
184
+ def silence(severity = ERROR, &block)
185
+ old_level = options.level
186
+ options.level = severity
187
+ result = block&.call
188
+ options.level = old_level
189
+ result
190
+ end
191
+
117
192
  class << self
118
193
  def default_options
119
194
  OpenStruct.new(
@@ -1,3 +1,3 @@
1
1
  module TestaLogger
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testa_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - karlo.razumovic