testa_logger 0.1.3 → 0.1.4

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: 0b34ca15c1ccd5e02e697e6cfbaab431b8a8e80482db7cd7ffd75c37e2c902c4
4
- data.tar.gz: 31bec113b6be9498b19f8e1842ee77316b333952988b930d1d74c3b8d11b2afc
3
+ metadata.gz: 80fa24df1415f3b2f87fb943bfe01ab6d027e4636e54532468b7b732b027a9d5
4
+ data.tar.gz: d13869b75f2b44dcbdf9bc8a7bb530a895e0e1b1883d626ccb3844ce31d1913b
5
5
  SHA512:
6
- metadata.gz: d23135c9d0c4740bf79ad76facfbf4d8649520c106c314ed8368263611999237c59a6a8eaeec934e044bebc6337fad742a2e6828873e9bcee63d962e3b4cd761
7
- data.tar.gz: f138359185e3ecec20f540ce8e3bcc80048bdfb82bb74532f46ccad87f660034260b9ab62887b231de198de609c5ab741ab59d2661583fc1db4f40ef3073d8b2
6
+ metadata.gz: '058bfb47171b98163822fd85b9ecdb1f64a1bac525c8fe579d2d3bd9979d2935bda018054d8d5991964c28824f7acc1fe48b92141446d952be4f745d17dd97ff'
7
+ data.tar.gz: 92795725d8008739aee95d2c887d499443c871af7bc6742951e830e397b5a051bae25c0c29cc7a59265ff24e72289bf0665328b9ea7611bebc5926104bfb546a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testa_logger (0.1.3)
4
+ testa_logger (0.1.4)
5
5
  activesupport
6
6
  awesome_print
7
7
  aws-sdk-s3
@@ -114,6 +114,73 @@ 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
+
117
184
  class << self
118
185
  def default_options
119
186
  OpenStruct.new(
@@ -1,3 +1,3 @@
1
1
  module TestaLogger
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - karlo.razumovic