testa_logger 0.1.3 → 0.1.4
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/Gemfile.lock +1 -1
- data/lib/testa_logger/logger.rb +67 -0
- data/lib/testa_logger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80fa24df1415f3b2f87fb943bfe01ab6d027e4636e54532468b7b732b027a9d5
|
4
|
+
data.tar.gz: d13869b75f2b44dcbdf9bc8a7bb530a895e0e1b1883d626ccb3844ce31d1913b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '058bfb47171b98163822fd85b9ecdb1f64a1bac525c8fe579d2d3bd9979d2935bda018054d8d5991964c28824f7acc1fe48b92141446d952be4f745d17dd97ff'
|
7
|
+
data.tar.gz: 92795725d8008739aee95d2c887d499443c871af7bc6742951e830e397b5a051bae25c0c29cc7a59265ff24e72289bf0665328b9ea7611bebc5926104bfb546a
|
data/Gemfile.lock
CHANGED
data/lib/testa_logger/logger.rb
CHANGED
@@ -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(
|
data/lib/testa_logger/version.rb
CHANGED