rjack-slf4j 1.7.7.1-java → 1.7.10.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: 68f4351d7a6899687bf4cb9746af07fec689d010
4
- data.tar.gz: d2b5062651eaa446805266493b366f23d605f212
3
+ metadata.gz: ff7fa05b1380b3ae2e24344427faf5563466f717
4
+ data.tar.gz: 81730d6ecda80edaad7b4770a5dbfe3b40792733
5
5
  SHA512:
6
- metadata.gz: a642c3d0960d9537c970e7f995c4bbc5479cd6afa31b249ac4f0d47fcbe6006960e7919663397c6f8c4ed481093d8110e3b8c373132b861f55183cacc664486d
7
- data.tar.gz: 07f5da008f606f5df3f185edfa9b9f4ea788cd75f704e12123942752d8186a0cf1145c1f26a83892a963d9e4109c58fdb5e04669d06b0e817bfd5337d19dd74d
6
+ metadata.gz: 1d5f833465c30b0d82e5e01e89d06a1964e75519981e15c7831f7b82b702452f004c1a3fcc48de6752abb81ba7352d237626faa599c06b69376498f1db4ad455
7
+ data.tar.gz: ceb76428852fbf8e6c103bfbf5ecd3d3813629e1ef75d498d5b59cf8e4acf1e1d9e90ad0a02ce4fef542e5f08a8c792273212179993752653a4e6897336565c3
@@ -1,3 +1,19 @@
1
+ === 1.7.10.0 (2015-1-30)
2
+ * Upgraded to SLF4J 1.7.10
3
+ * Somewhere in the JRuby 1.7.x series, exceptions from java that are
4
+ rescued in ruby are no longer being wrapped in the NativeException
5
+ ruby class. Update the Logger to also send exceptions of type
6
+ java.lang.Throwable directly though the SLF4J API. Previous to this
7
+ fix, java exceptions were being logged like ruby exceptions.
8
+ * Add RJack::SLF4J.ruby_ex_format for globally configurable formatting
9
+ of ruby exceptions as log messages. Ruby exceptions aren't java
10
+ Throwable so they won't be formatted by the SLF4J java
11
+ API. Compatibility with java exception formatting is dependent on
12
+ the output adapter and its configuration, so this can be set in the
13
+ same place. Also changed the default format separator between the
14
+ (prefix) message and exception class name from NEWLINE to SPACE,
15
+ given at least one raised issue (#7) of incompatibly.
16
+
1
17
  === 1.7.7.1 (2014-8-20)
2
18
  * Add one remaining ::Logger compat alias RJack::SLF4J::Logger#unknown
3
19
 
@@ -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.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
21
+ lib/rjack-slf4j/jcl-over-slf4j-1.7.10.jar
22
+ lib/rjack-slf4j/jul-to-slf4j-1.7.10.jar
23
+ lib/rjack-slf4j/log4j-over-slf4j-1.7.10.jar
24
+ lib/rjack-slf4j/slf4j-api-1.7.10.jar
25
+ lib/rjack-slf4j/slf4j-jcl-1.7.10.jar
26
+ lib/rjack-slf4j/slf4j-jdk14-1.7.10.jar
27
+ lib/rjack-slf4j/slf4j-log4j12-1.7.10.jar
28
+ lib/rjack-slf4j/slf4j-nop-1.7.10.jar
29
+ lib/rjack-slf4j/slf4j-simple-1.7.10.jar
@@ -37,7 +37,7 @@ components in a JRuby application.
37
37
 
38
38
  === rjack-slf4j gem
39
39
 
40
- Copyright (c) 2008-2014 David Kellum
40
+ Copyright (c) 2008-2015 David Kellum
41
41
  All rights reserved.
42
42
 
43
43
  The SLF4J ruby wrapper and gem packaging is released under the same
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2014 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person
5
5
  # obtaining a copy of this software and associated documentation files
@@ -123,12 +123,28 @@ module RJack
123
123
  @@api_loader = org.slf4j.ILoggerFactory.java_class.class_loader
124
124
  @@loaded = {}
125
125
  @@output_name = nil
126
+ @@ruby_ex_format = "%s %s: %s\n".freeze
126
127
 
127
128
  # Output adapter name if one has been added, or nil.
128
129
  def self.output_name
129
130
  @@output_name
130
131
  end
131
132
 
133
+ # A (sprintf) format string to use when synthesizing a log message
134
+ # from a prefix message (msg) (i.e. "Exception:") and ruby
135
+ # exception (ex) using [ msg, ex.class.name, ex.cause ]. Since
136
+ # ruby exceptions aren't instances of java Throwable, they can't
137
+ # be passed directly. This can be globally set to match the
138
+ # formatting of the output adapter (i.e. for java exceptions),
139
+ # preferably in the same place it is required and configured.
140
+ def self.ruby_ex_format
141
+ @@ruby_ex_format
142
+ end
143
+
144
+ def self.ruby_ex_format=( f )
145
+ @@ruby_ex_format = f.dup.freeze
146
+ end
147
+
132
148
  # SLF4J severity levels
133
149
  LEVELS = %w{ trace debug info warn error }
134
150
 
@@ -208,7 +224,8 @@ module RJack
208
224
  end
209
225
 
210
226
  def #{lvl}( msg=nil, ex=nil )
211
- if msg.is_a?( Exception ) && ex.nil?
227
+ if ex.nil? && ( msg.is_a?( Exception ) ||
228
+ msg.is_a?( java.lang.Throwable ) )
212
229
  msg, ex = "Exception:", msg
213
230
  end
214
231
  msg = yield if ( block_given? && #{lvl}? )
@@ -223,16 +240,17 @@ module RJack
223
240
  end
224
241
 
225
242
  def #{lvl}_ex( msg, ex )
226
- if ex.is_a?( NativeException )
243
+ if ex.is_a?( java.lang.Throwable )
244
+ @logger.#{lvl}( msg.to_s, ex )
245
+ elsif ex.is_a?( NativeException )
227
246
  @logger.#{lvl}( msg.to_s, ex.cause )
228
247
  elsif #{lvl}?
229
- log = msg.to_s.dup
230
- log << '\n'
231
- log << ex.class.name << ': ' << ex.message << '\n'
248
+ lm = sprintf( SLF4J.ruby_ex_format,
249
+ msg, ex.class.name, ex.message )
232
250
  ex.backtrace && ex.backtrace.each do |b|
233
- log << '\t' << b << '\n'
251
+ lm << '\t' << b << '\n'
234
252
  end
235
- @logger.#{lvl}( log )
253
+ @logger.#{lvl}( lm )
236
254
  end
237
255
  true
238
256
  end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2014 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person
5
5
  # obtaining a copy of this software and associated documentation files
@@ -26,9 +26,9 @@ module RJack
26
26
  module SLF4J
27
27
 
28
28
  # SLF4J-java version
29
- SLF4J_VERSION = '1.7.7'
29
+ SLF4J_VERSION = '1.7.10'
30
30
  # SLF4J gem version
31
- VERSION = SLF4J_VERSION + '.1'
31
+ VERSION = SLF4J_VERSION + '.0'
32
32
 
33
33
  SLF4J_DIR = File.dirname(__FILE__) # :nodoc:
34
34
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2014 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  # All rights reserved.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2014 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person
5
5
  # obtaining a copy of this software and associated documentation files
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2014 David Kellum
2
+ # Copyright (c) 2008-2015 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You
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.7</version>
19
+ <version>1.7.10</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.7</version>
25
+ <version>1.7.10</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.7</version>
32
+ <version>1.7.10</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.7</version>
39
+ <version>1.7.10</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.7</version>
46
+ <version>1.7.10</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.7</version>
54
+ <version>1.7.10</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.7</version>
62
+ <version>1.7.10</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.7</version>
70
+ <version>1.7.10</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.7</version>
78
+ <version>1.7.10</version>
79
79
  <scope>runtime</scope>
80
80
  <optional>true</optional>
81
81
  </dependency>
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env jruby
2
2
  #--
3
- # Copyright (c) 2008-2014 David Kellum
3
+ # Copyright (c) 2008-2015 David Kellum
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person
6
6
  # obtaining a copy of this software and associated documentation files
@@ -2,7 +2,7 @@
2
2
  #.hashdot.profile += jruby-shortlived
3
3
 
4
4
  #--
5
- # Copyright (c) 2008-2014 David Kellum
5
+ # Copyright (c) 2008-2015 David Kellum
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person
8
8
  # obtaining a copy of this software and associated documentation files
@@ -81,6 +81,7 @@ class TestSlf4j < MiniTest::Unit::TestCase
81
81
  @jdk_logger = JdkLogger.getLogger ""
82
82
  @jdk_logger.addHandler @handler
83
83
  @jdk_logger.level = java.util.logging.Level::INFO
84
+ SLF4J.ruby_ex_format = "%s\n%s: %s\n".freeze
84
85
  @log = SLF4J[ "my.app" ]
85
86
  end
86
87
 
@@ -115,7 +116,15 @@ class TestSlf4j < MiniTest::Unit::TestCase
115
116
  @log.error( "test java exception", x )
116
117
  end
117
118
  assert_equal( 1, @handler.count )
118
- assert_same( ex.cause, @handler.last.thrown )
119
+ if ex.cause #old NativeException jruby 1.6.x case
120
+ assert_same( ex.cause, @handler.last.thrown )
121
+ else
122
+ assert_same( ex, @handler.last.thrown )
123
+ end
124
+
125
+ mlines = @handler.last.message.split($/)
126
+ assert_equal( 1, mlines.length )
127
+ assert_equal( "test java exception", mlines[0] )
119
128
  end
120
129
 
121
130
  def test_ruby_exception
@@ -135,6 +144,9 @@ class TestSlf4j < MiniTest::Unit::TestCase
135
144
  @log.error( msg, x )
136
145
  end
137
146
  assert_equal( 1, @handler.count )
147
+ mlines = @handler.last.message.split($/)
148
+ assert_equal( "my message", mlines[0] )
149
+ assert_match( /^ZeroDivisionError: /, mlines[1] )
138
150
  end
139
151
 
140
152
  def test_ruby_exception_block
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjack-slf4j
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7.1
4
+ version: 1.7.10.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-08-20 00:00:00.000000000 Z
11
+ date: 2015-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: minitest
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: 4.7.4
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
16
  - - ~>
23
17
  - !ruby/object:Gem::Version
24
18
  version: 4.7.4
19
+ name: minitest
25
20
  prerelease: false
26
21
  type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rdoc
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
24
  - - ~>
32
25
  - !ruby/object:Gem::Version
33
- version: 4.0.1
26
+ version: 4.7.4
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
30
  - - ~>
37
31
  - !ruby/object:Gem::Version
38
32
  version: 4.0.1
33
+ name: rdoc
39
34
  prerelease: false
40
35
  type: :development
41
- - !ruby/object:Gem::Dependency
42
- name: rjack-tarpit
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
38
  - - ~>
46
39
  - !ruby/object:Gem::Version
47
- version: '2.1'
40
+ version: 4.0.1
41
+ - !ruby/object:Gem::Dependency
48
42
  requirement: !ruby/object:Gem::Requirement
49
43
  requirements:
50
44
  - - ~>
51
45
  - !ruby/object:Gem::Version
52
46
  version: '2.1'
47
+ name: rjack-tarpit
53
48
  prerelease: false
54
49
  type: :development
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.1'
55
55
  description: A JRuby adaption and gem packaging of the Simple Logging Facade for Java. Provides all jar dependencies and a Ruby Logger compatible facade.
56
56
  email:
57
57
  - dek-oss@gravitext.com
@@ -81,15 +81,15 @@ 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.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
84
+ - lib/rjack-slf4j/jcl-over-slf4j-1.7.10.jar
85
+ - lib/rjack-slf4j/jul-to-slf4j-1.7.10.jar
86
+ - lib/rjack-slf4j/log4j-over-slf4j-1.7.10.jar
87
+ - lib/rjack-slf4j/slf4j-api-1.7.10.jar
88
+ - lib/rjack-slf4j/slf4j-jcl-1.7.10.jar
89
+ - lib/rjack-slf4j/slf4j-jdk14-1.7.10.jar
90
+ - lib/rjack-slf4j/slf4j-log4j12-1.7.10.jar
91
+ - lib/rjack-slf4j/slf4j-nop-1.7.10.jar
92
+ - lib/rjack-slf4j/slf4j-simple-1.7.10.jar
93
93
  homepage: http://rjack.gravitext.com/slf4j
94
94
  licenses: []
95
95
  metadata: {}