rjack-slf4j 1.7.6.0-java → 1.7.7.0-java

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
  SHA1:
3
- metadata.gz: ca89789ff76409fd3c7a5aa17447ee35e8f4ee9d
4
- data.tar.gz: 9c781677306044b043fa1b32c3301acb075556aa
3
+ metadata.gz: 4d986d77dfb54bd6456c56c2a14fa207f95ccd4b
4
+ data.tar.gz: f02716edd0b092aee397f3b264c4424ed08a76c8
5
5
  SHA512:
6
- metadata.gz: 0d6a3ab3d4c9b65a29e278606946bdc9b992cee27ff561f654ba3110f07b50161b7a3d467870db54565b0d7dbaa88471321c48de2ad77a8fc36be916a3c0b9ec
7
- data.tar.gz: f10d149958449e5801b4a071279a7100968d2143e72e2762ac9c3bd374ece16f3ef00bcf9d93ea6fb04dfd9c1bd950cdd8890e73a74eeaefbeebf964033b2e39
6
+ metadata.gz: 04a28357534c8e4fce46577d18c4f73162c05d51da23738313be58e75208f82685f0a6a2e9dbc9051047a153749c06eb1843c596cadd275179185f99fcb65195
7
+ data.tar.gz: 51332b4d7be180e55ac61100430a9926e4db30d10d0369c106e6e467d5955aa4599bb77f3ed67a94d57d34e054e23f97c2958e999b23f4b612cec243cc17abe3
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.7.7.0 (2014-8-19)
2
+ * Upgraded to SLF4J 1.7.7
3
+ * Add check to log exceptions with nil backtrace
4
+ * Complete RJack::SLF4J::Logger interface compatibility with Ruby
5
+ ::Logger by added aliases, adaptions, and no-op accessors (fixes #6)
6
+
1
7
  === 1.7.6.0 (2014-2-17)
2
8
  * Upgraded to SLF4J 1.7.6
3
9
 
data/Manifest.txt CHANGED
@@ -18,12 +18,12 @@ lib/rjack-slf4j/log4j-over-slf4j.rb
18
18
  lib/rjack-slf4j/log4j12.rb
19
19
  lib/rjack-slf4j/nop.rb
20
20
  lib/rjack-slf4j/simple.rb
21
- lib/rjack-slf4j/jcl-over-slf4j-1.7.6.jar
22
- lib/rjack-slf4j/jul-to-slf4j-1.7.6.jar
23
- lib/rjack-slf4j/log4j-over-slf4j-1.7.6.jar
24
- lib/rjack-slf4j/slf4j-api-1.7.6.jar
25
- lib/rjack-slf4j/slf4j-jcl-1.7.6.jar
26
- lib/rjack-slf4j/slf4j-jdk14-1.7.6.jar
27
- lib/rjack-slf4j/slf4j-log4j12-1.7.6.jar
28
- lib/rjack-slf4j/slf4j-nop-1.7.6.jar
29
- lib/rjack-slf4j/slf4j-simple-1.7.6.jar
21
+ lib/rjack-slf4j/jcl-over-slf4j-1.7.7.jar
22
+ lib/rjack-slf4j/jul-to-slf4j-1.7.7.jar
23
+ lib/rjack-slf4j/log4j-over-slf4j-1.7.7.jar
24
+ lib/rjack-slf4j/slf4j-api-1.7.7.jar
25
+ lib/rjack-slf4j/slf4j-jcl-1.7.7.jar
26
+ lib/rjack-slf4j/slf4j-jdk14-1.7.7.jar
27
+ lib/rjack-slf4j/slf4j-log4j12-1.7.7.jar
28
+ lib/rjack-slf4j/slf4j-nop-1.7.7.jar
29
+ lib/rjack-slf4j/slf4j-simple-1.7.7.jar
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = rjack-slf4j
2
2
 
3
- * http://rjack.rubyforge.org/slf4j
4
- * http://rjack.rubyforge.org
3
+ * http://rjack.gravitext.com/slf4j
4
+ * http://rjack.gravitext.com
5
5
  * https://github.com/dekellum/rjack
6
6
 
7
7
  == Description
data/Rakefile CHANGED
@@ -6,10 +6,6 @@ require 'rjack-tarpit'
6
6
 
7
7
  RJack::TarPit.new( 'rjack-slf4j' ) do |tp|
8
8
 
9
- tp.rdoc_destinations <<
10
- 'dekellum@rubyforge.org:/var/www/gforge-projects/rjack/slf4j'
11
- tp.publish_rdoc_rsync_flags = %w[ -rL ]
12
-
13
9
  tp.spec.loaders.each do |adapter|
14
10
  file( "lib/rjack-slf4j/#{adapter}.rb" =>
15
11
  [ "lib/rjack-slf4j/base.rb", 'Rakefile' ] ) do
@@ -23,3 +19,10 @@ END
23
19
  end
24
20
 
25
21
  end
22
+
23
+ desc "Upload RDOC to Amazon S3 (rdoc.gravitext.com/rjack, Oregon)"
24
+ task :publish_rdoc => [ :clean, :rerdoc ] do
25
+ sh <<-SH
26
+ aws s3 sync --acl public-read doc/ s3://rjack.gravitext.com/slf4j/
27
+ SH
28
+ end
data/lib/rjack-slf4j.rb CHANGED
@@ -49,7 +49,7 @@ module RJack
49
49
  # require 'rjack-slf4j/nop' # NOP null logger (provided)
50
50
  # require 'rjack-slf4j/simple' # Simple logger (provided)
51
51
  #
52
- # The rjack-logback[http://rjack.rubyforge.org/logback] gem may
52
+ # The rjack-logback[http://rjack.gravitext.com/logback] gem may
53
53
  # also be be used as the output adapter:
54
54
  #
55
55
  # require 'rjack-logback'
@@ -145,7 +145,7 @@ module RJack
145
145
  alias ruby_to_java_logger_name to_log_name
146
146
  end
147
147
 
148
- # Logger compatible facade over org.slf4j.Logger
148
+ # Ruby ::Logger compatible adapter for org.slf4j.Logger
149
149
  #
150
150
  # === Generated Methods
151
151
  #
@@ -191,6 +191,7 @@ module RJack
191
191
  def initialize( name )
192
192
  @name = name.is_a?( Module ) ? SLF4J.to_log_name( name ) : name
193
193
  @logger = org.slf4j.LoggerFactory.getLogger( @name )
194
+ @level = 0 #DEBUG
194
195
  end
195
196
 
196
197
  # Return underlying org.slf4j.Logger
@@ -218,6 +219,7 @@ module RJack
218
219
  @logger.#{lvl}( msg.to_s )
219
220
  end
220
221
  end
222
+ true
221
223
  end
222
224
 
223
225
  def #{lvl}_ex( msg, ex )
@@ -227,19 +229,91 @@ module RJack
227
229
  log = msg.to_s.dup
228
230
  log << '\n'
229
231
  log << ex.class.name << ': ' << ex.message << '\n'
230
- ex.backtrace.each do |b|
232
+ ex.backtrace && ex.backtrace.each do |b|
231
233
  log << '\t' << b << '\n'
232
234
  end
233
235
  @logger.#{lvl}( log )
234
236
  end
237
+ true
235
238
  end
236
239
 
237
240
  } )
238
241
  end
239
242
 
240
- # Alias fatal to error for Logger compatibility
241
- alias_method :fatal, :error
242
- alias_method :fatal?, :error?
243
+ # Unused attribute, for Ruby ::Logger compatibility.
244
+ attr_reader :progname
245
+
246
+ # Unused attribute, for Ruby ::Logger compatibility.
247
+ def progname=( v )
248
+ debug { "Setting SLF4J::Logger progname=#{v.inspect} has no effect" }
249
+ @progname = v
250
+ end
251
+
252
+ # Unused attribute, for Ruby ::Logger compatibility.
253
+ attr_reader :level
254
+
255
+ # Unused attribute, for Ruby ::Logger compatibility.
256
+ def level=( v )
257
+ debug { "Setting SLF4J::Logger level=#{v.inspect} has no effect" }
258
+ @level = v
259
+ end
260
+
261
+ # Unused attribute alias, for Ruby ::Logger compatibility.
262
+ alias sev_threshold level
263
+ alias sev_threshold= level=
264
+
265
+ # Unused attribute, for Ruby ::Logger compatibility.
266
+ attr_reader :datetime_format
267
+
268
+ # Unused attribute, for Ruby ::Logger compatibility.
269
+ def datetime_format=( v )
270
+ debug { "Setting SLF4J::Logger datetime_format=#{v.inspect} has no effect" }
271
+ @datetime_format = v
272
+ end
273
+
274
+ # Unused attribute, for Ruby ::Logger compatibility.
275
+ attr_reader :formatter
276
+
277
+ # Unused attribute, for Ruby ::Logger compatibility.
278
+ def formatter=( v )
279
+ debug { "Setting SLF4J::Logger formatter=#{v.inspect} has no effect" }
280
+ @formatter = v
281
+ end
282
+
283
+ # Alias to #error for Ruby ::Logger compatibility
284
+ alias fatal error
285
+ alias fatal? error?
286
+
287
+ # Alias to #info for Ruby ::Logger compatibility. Extend to map to
288
+ # a different level.
289
+ alias << info
290
+
291
+ # Log via Ruby ::Logger levels, for compatibility.
292
+ # UNKNOWN or nil level is mapped to #info
293
+ def add( rlvl, msg = nil, progname = nil, &block )
294
+ case rlvl
295
+ when 0 #DEBUG
296
+ debug( msg, &block )
297
+ when 1 #INFO
298
+ info( msg, &block )
299
+ when 2 #WARN
300
+ warn( msg, &block )
301
+ when 3 #ERROR
302
+ error( msg, &block )
303
+ when 4 #FATAL
304
+ error( msg, &block )
305
+ else #UNKNOWN, nil
306
+ info( msg, &block )
307
+ end
308
+ end
309
+
310
+ alias log add
311
+
312
+ # No-Op, for Ruby ::Logger compatibility.
313
+ def close
314
+ #No-OP
315
+ end
316
+
243
317
  end
244
318
 
245
319
  # Get Logger by name
@@ -26,7 +26,7 @@ module RJack
26
26
  module SLF4J
27
27
 
28
28
  # SLF4J-java version
29
- SLF4J_VERSION = '1.7.6'
29
+ SLF4J_VERSION = '1.7.7'
30
30
  # SLF4J gem version
31
31
  VERSION = SLF4J_VERSION + '.0'
32
32
 
Binary file
Binary file
data/pom.xml CHANGED
@@ -16,34 +16,34 @@
16
16
  <dependency>
17
17
  <groupId>org.slf4j</groupId>
18
18
  <artifactId>slf4j-api</artifactId>
19
- <version>1.7.6</version>
19
+ <version>1.7.7</version>
20
20
  </dependency>
21
21
 
22
22
  <dependency>
23
23
  <groupId>org.slf4j</groupId>
24
24
  <artifactId>jcl-over-slf4j</artifactId>
25
- <version>1.7.6</version>
25
+ <version>1.7.7</version>
26
26
  <scope>runtime</scope>
27
27
  </dependency>
28
28
 
29
29
  <dependency>
30
30
  <groupId>org.slf4j</groupId>
31
31
  <artifactId>jul-to-slf4j</artifactId>
32
- <version>1.7.6</version>
32
+ <version>1.7.7</version>
33
33
  <scope>runtime</scope>
34
34
  </dependency>
35
35
 
36
36
  <dependency>
37
37
  <groupId>org.slf4j</groupId>
38
38
  <artifactId>log4j-over-slf4j</artifactId>
39
- <version>1.7.6</version>
39
+ <version>1.7.7</version>
40
40
  <scope>runtime</scope>
41
41
  </dependency>
42
42
 
43
43
  <dependency>
44
44
  <groupId>org.slf4j</groupId>
45
45
  <artifactId>slf4j-jdk14</artifactId>
46
- <version>1.7.6</version>
46
+ <version>1.7.7</version>
47
47
  <scope>runtime</scope>
48
48
  <optional>true</optional>
49
49
  </dependency>
@@ -51,7 +51,7 @@
51
51
  <dependency>
52
52
  <groupId>org.slf4j</groupId>
53
53
  <artifactId>slf4j-log4j12</artifactId>
54
- <version>1.7.6</version>
54
+ <version>1.7.7</version>
55
55
  <scope>runtime</scope>
56
56
  <optional>true</optional>
57
57
  </dependency>
@@ -59,7 +59,7 @@
59
59
  <dependency>
60
60
  <groupId>org.slf4j</groupId>
61
61
  <artifactId>slf4j-jcl</artifactId>
62
- <version>1.7.6</version>
62
+ <version>1.7.7</version>
63
63
  <scope>runtime</scope>
64
64
  <optional>true</optional>
65
65
  </dependency>
@@ -67,7 +67,7 @@
67
67
  <dependency>
68
68
  <groupId>org.slf4j</groupId>
69
69
  <artifactId>slf4j-simple</artifactId>
70
- <version>1.7.6</version>
70
+ <version>1.7.7</version>
71
71
  <scope>runtime</scope>
72
72
  <optional>true</optional>
73
73
  </dependency>
@@ -75,7 +75,7 @@
75
75
  <dependency>
76
76
  <groupId>org.slf4j</groupId>
77
77
  <artifactId>slf4j-nop</artifactId>
78
- <version>1.7.6</version>
78
+ <version>1.7.7</version>
79
79
  <scope>runtime</scope>
80
80
  <optional>true</optional>
81
81
  </dependency>
data/test/test_slf4j.rb CHANGED
@@ -159,3 +159,68 @@ class TestSlf4j < MiniTest::Unit::TestCase
159
159
  end
160
160
 
161
161
  end
162
+
163
+ require 'logger'
164
+
165
+ class TestCompatibility < MiniTest::Unit::TestCase
166
+
167
+ def setup
168
+ @jdk_logger = java.util.logging.Logger::getLogger( "" )
169
+ @jdk_logger.level = java.util.logging.Level::ALL
170
+ @jdk_logger.handlers.each do |h|
171
+ h.level = java.util.logging.Level::ALL
172
+ end
173
+ end
174
+
175
+ def test_ruby_logger
176
+ # minitest mucks with STDOUT? So use file...
177
+ File.open( File.expand_path( '../logger.out', __FILE__ ), 'w' ) do |fout|
178
+ logger_like?( ::Logger.new( fout ) )
179
+ end
180
+ end
181
+
182
+ def test_slf4j_logger
183
+ logger_like?( RJack::SLF4J['compat'] )
184
+ end
185
+
186
+ def logger_like?( l )
187
+ assert_equal( ::Logger::DEBUG, l.level )
188
+ l.level = ::Logger::INFO
189
+ assert_equal( ::Logger::INFO, l.level )
190
+
191
+ l.sev_threshold = ::Logger::INFO
192
+ assert_equal( ::Logger::INFO, l.sev_threshold )
193
+
194
+ assert_equal( true, l.info? )
195
+
196
+ assert_equal( true, l.add( ::Logger::INFO, 'message', 'program' ) )
197
+ assert_equal( true, l.add( ::Logger::INFO, 'message' ) )
198
+ assert_equal( true, l.add( ::Logger::INFO ) )
199
+ assert_equal( true, l.add( ::Logger::INFO ) { "message" } )
200
+
201
+ assert_equal( true, l.log( ::Logger::INFO, 'message' ) )
202
+
203
+ assert_equal( true, l.info( "message" ) )
204
+ assert_equal( true, l.info( "progname" ) { "message" } )
205
+ assert_equal( true, l.info( "message" ) )
206
+ assert_equal( true, l.info( RuntimeError.new( "exception" ) ) )
207
+ assert_equal( true, l.info( RuntimeError.new( "exception" ) ) { "other" } )
208
+
209
+ l << 'dump'
210
+
211
+ assert_nil( l.datetime_format )
212
+ l.datetime_format = '%Y-%m-%d %H:%M:%S'
213
+ assert_equal( '%Y-%m-%d %H:%M:%S', l.datetime_format )
214
+
215
+ assert_nil( l.formatter )
216
+ l.formatter = x = proc {}
217
+ assert_equal( x, l.formatter )
218
+
219
+ assert_nil( l.progname )
220
+ l.progname = 'program'
221
+ assert_equal( 'program', l.progname )
222
+
223
+ l.close
224
+ end
225
+
226
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjack-slf4j
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.6.0
4
+ version: 1.7.7.0
5
5
  platform: java
6
6
  authors:
7
7
  - David Kellum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-17 00:00:00.000000000 Z
11
+ date: 2014-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -81,16 +81,16 @@ files:
81
81
  - lib/rjack-slf4j/log4j12.rb
82
82
  - lib/rjack-slf4j/nop.rb
83
83
  - lib/rjack-slf4j/simple.rb
84
- - lib/rjack-slf4j/jcl-over-slf4j-1.7.6.jar
85
- - lib/rjack-slf4j/jul-to-slf4j-1.7.6.jar
86
- - lib/rjack-slf4j/log4j-over-slf4j-1.7.6.jar
87
- - lib/rjack-slf4j/slf4j-api-1.7.6.jar
88
- - lib/rjack-slf4j/slf4j-jcl-1.7.6.jar
89
- - lib/rjack-slf4j/slf4j-jdk14-1.7.6.jar
90
- - lib/rjack-slf4j/slf4j-log4j12-1.7.6.jar
91
- - lib/rjack-slf4j/slf4j-nop-1.7.6.jar
92
- - lib/rjack-slf4j/slf4j-simple-1.7.6.jar
93
- homepage: http://rjack.rubyforge.org/slf4j
84
+ - lib/rjack-slf4j/jcl-over-slf4j-1.7.7.jar
85
+ - lib/rjack-slf4j/jul-to-slf4j-1.7.7.jar
86
+ - lib/rjack-slf4j/log4j-over-slf4j-1.7.7.jar
87
+ - lib/rjack-slf4j/slf4j-api-1.7.7.jar
88
+ - lib/rjack-slf4j/slf4j-jcl-1.7.7.jar
89
+ - lib/rjack-slf4j/slf4j-jdk14-1.7.7.jar
90
+ - lib/rjack-slf4j/slf4j-log4j12-1.7.7.jar
91
+ - lib/rjack-slf4j/slf4j-nop-1.7.7.jar
92
+ - lib/rjack-slf4j/slf4j-simple-1.7.7.jar
93
+ homepage: http://rjack.gravitext.com/slf4j
94
94
  licenses: []
95
95
  metadata: {}
96
96
  post_install_message:
Binary file
Binary file
Binary file
Binary file