rjack-slf4j 1.7.7.0-java → 1.7.7.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.rdoc +3 -0
- data/lib/rjack-slf4j.rb +4 -0
- data/lib/rjack-slf4j/base.rb +1 -1
- data/test/test_slf4j.rb +13 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68f4351d7a6899687bf4cb9746af07fec689d010
|
4
|
+
data.tar.gz: d2b5062651eaa446805266493b366f23d605f212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a642c3d0960d9537c970e7f995c4bbc5479cd6afa31b249ac4f0d47fcbe6006960e7919663397c6f8c4ed481093d8110e3b8c373132b861f55183cacc664486d
|
7
|
+
data.tar.gz: 07f5da008f606f5df3f185edfa9b9f4ea788cd75f704e12123942752d8186a0cf1145c1f26a83892a963d9e4109c58fdb5e04669d06b0e817bfd5337d19dd74d
|
data/History.rdoc
CHANGED
data/lib/rjack-slf4j.rb
CHANGED
@@ -288,6 +288,10 @@ module RJack
|
|
288
288
|
# a different level.
|
289
289
|
alias << info
|
290
290
|
|
291
|
+
# Alias to #info for Ruby ::Logger compatibility. Extend to map to
|
292
|
+
# a different level.
|
293
|
+
alias unknown info
|
294
|
+
|
291
295
|
# Log via Ruby ::Logger levels, for compatibility.
|
292
296
|
# UNKNOWN or nil level is mapped to #info
|
293
297
|
def add( rlvl, msg = nil, progname = nil, &block )
|
data/lib/rjack-slf4j/base.rb
CHANGED
data/test/test_slf4j.rb
CHANGED
@@ -183,6 +183,15 @@ class TestCompatibility < MiniTest::Unit::TestCase
|
|
183
183
|
logger_like?( RJack::SLF4J['compat'] )
|
184
184
|
end
|
185
185
|
|
186
|
+
def test_compare_methods
|
187
|
+
File.open( File.expand_path( '../logger.out', __FILE__ ), 'w' ) do |fout|
|
188
|
+
r_mths = ::Logger.new( fout ).public_methods.sort
|
189
|
+
s_mths = RJack::SLF4J['compat'].public_methods.sort
|
190
|
+
assert_equal( [], (r_mths - s_mths),
|
191
|
+
"::Logger methods not in SLF4J::Logger" )
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
186
195
|
def logger_like?( l )
|
187
196
|
assert_equal( ::Logger::DEBUG, l.level )
|
188
197
|
l.level = ::Logger::INFO
|
@@ -191,7 +200,7 @@ class TestCompatibility < MiniTest::Unit::TestCase
|
|
191
200
|
l.sev_threshold = ::Logger::INFO
|
192
201
|
assert_equal( ::Logger::INFO, l.sev_threshold )
|
193
202
|
|
194
|
-
assert_equal( true,
|
203
|
+
assert_equal( true, l.info? )
|
195
204
|
|
196
205
|
assert_equal( true, l.add( ::Logger::INFO, 'message', 'program' ) )
|
197
206
|
assert_equal( true, l.add( ::Logger::INFO, 'message' ) )
|
@@ -206,6 +215,9 @@ class TestCompatibility < MiniTest::Unit::TestCase
|
|
206
215
|
assert_equal( true, l.info( RuntimeError.new( "exception" ) ) )
|
207
216
|
assert_equal( true, l.info( RuntimeError.new( "exception" ) ) { "other" } )
|
208
217
|
|
218
|
+
assert_equal( true, l.add( ::Logger::UNKNOWN, 'message' ) )
|
219
|
+
l.unknown( 'message' )
|
220
|
+
|
209
221
|
l << 'dump'
|
210
222
|
|
211
223
|
assert_nil( l.datetime_format )
|