log4jruby 0.5.0-java → 1.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d7b52629c2bce0a86c3c6f6066feed253bf1601c
4
+ data.tar.gz: 07c6e9bcee9be459a4daebb35b6fdf06c1265759
5
+ SHA512:
6
+ metadata.gz: b7d74dde33794356649e78b612c1d5d2f65e613170dbf96387ad3ea15a5049695ed9a9597e219de70dc0c3cbf30f7ecde3f1a294e6eb91b52b7c6bb4efa79562
7
+ data.tar.gz: eae0c2c75e71a0b91509b0351160b7ecddf1c1ea73105b5bfb543f4acac7da475a698ffa71bd0f2c0b7132613dd1056300a3d22bf948335332e0b17d67fc9985
data/History.txt CHANGED
@@ -0,0 +1,6 @@
1
+ 1.0.0.rc1
2
+
3
+ * setting level now accepts ::Logger constants and symbols
4
+ * Logger#level now returns ::Logger constant values instead of Log4j log level classes.
5
+ Note, you can still get at log4j constants via #log4_logger.level
6
+ * Logger#level now returns effective log level (i.e. parent logger's level when not explicitly set)
@@ -1,5 +1,7 @@
1
1
  require 'log4jruby/log4j_args'
2
2
 
3
+ require 'logger'
4
+
3
5
  module Log4jruby
4
6
 
5
7
  # Author:: Lenny Marks
@@ -10,7 +12,15 @@ module Log4jruby
10
12
  # * fileName, lineNumber, methodName available to appender layouts via MDC variables(e.g. %X{lineNumber})
11
13
  class Logger
12
14
  BLANK_CALLER = ['', '', ''] #:nodoc:
13
-
15
+
16
+ LOG4J_LEVELS = {
17
+ Java::org.apache.log4j.Level::DEBUG => ::Logger::DEBUG,
18
+ Java::org.apache.log4j.Level::INFO => ::Logger::INFO,
19
+ Java::org.apache.log4j.Level::WARN => ::Logger::WARN,
20
+ Java::org.apache.log4j.Level::ERROR => ::Logger::ERROR,
21
+ Java::org.apache.log4j.Level::FATAL => ::Logger::FATAL,
22
+ }
23
+
14
24
  # turn tracing on to make fileName, lineNumber, and methodName available to
15
25
  # appender layout through MDC(ie. %X{fileName} %X{lineNumber} %X{methodName})
16
26
  attr_accessor :tracing
@@ -62,24 +72,26 @@ module Log4jruby
62
72
  end
63
73
  end
64
74
 
65
- # Shortcut for setting log levels. (:debug, :info, :warn, :error)
75
+ # Shortcut for setting log levels. (:debug, :info, :warn, :error, :fatal)
66
76
  def level=(level)
67
77
  @logger.level = case level
68
- when :debug
69
- then Java::org.apache.log4j.Level::DEBUG
70
- when :info
71
- then Java::org.apache.log4j.Level::INFO
72
- when :warn
73
- then Java::org.apache.log4j.Level::WARN
74
- when :error
75
- then Java::org.apache.log4j.Level::ERROR
78
+ when :debug, ::Logger::DEBUG
79
+ Java::org.apache.log4j.Level::DEBUG
80
+ when :info, ::Logger::INFO
81
+ Java::org.apache.log4j.Level::INFO
82
+ when :warn, ::Logger::WARN
83
+ Java::org.apache.log4j.Level::WARN
84
+ when :error, ::Logger::ERROR
85
+ Java::org.apache.log4j.Level::ERROR
86
+ when :fatal, ::Logger::FATAL
87
+ Java::org.apache.log4j.Level::FATAL
76
88
  else
77
89
  raise NotImplementedError
78
90
  end
79
91
  end
80
92
 
81
93
  def level
82
- @logger.level
94
+ LOG4J_LEVELS[@logger.effectiveLevel]
83
95
  end
84
96
 
85
97
  def flush
@@ -159,12 +171,9 @@ module Log4jruby
159
171
  Logger.logger_mapping
160
172
  end
161
173
 
162
- def initialize(logger, values = {}) # :nodoc:
163
- @logger = logger
164
-
174
+ def initialize(logger) # :nodoc:
175
+ @logger = logger
165
176
  Logger.logger_mapping[@logger] = self
166
-
167
- self.attributes = values
168
177
  end
169
178
 
170
179
  def with_context # :nodoc:
@@ -1,3 +1,3 @@
1
1
  module Log4jruby
2
- VERSION = '0.5.0'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,62 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: log4jruby
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.5.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
6
5
  platform: java
7
- authors:
8
- - Lenny Marks
9
- autorequire:
6
+ authors:
7
+ - Lenny Marks
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
-
13
- date: 2012-11-25 00:00:00 Z
11
+ date: 2014-08-06 00:00:00.000000000 Z
14
12
  dependencies: []
15
-
16
13
  description: Ruby Logger using Log4j, geared toward those who use JRuby to write Ruby code using/extending Java code. Ruby and Java are configured together using traditional Log4j methods.
17
- email:
18
- - lenny@aps.org
14
+ email:
15
+ - lenny@aps.org
19
16
  executables: []
20
-
21
17
  extensions: []
22
-
23
18
  extra_rdoc_files: []
24
-
25
- files:
26
- - lib/log4jruby.rb
27
- - lib/log4jruby/log4j_args.rb
28
- - lib/log4jruby/logger.rb
29
- - lib/log4jruby/logger_for_class.rb
30
- - lib/log4jruby/rails.rb
31
- - lib/log4jruby/version.rb
32
- - README.rdoc
33
- - History.txt
19
+ files:
20
+ - History.txt
21
+ - README.rdoc
22
+ - lib/log4jruby.rb
23
+ - lib/log4jruby/log4j_args.rb
24
+ - lib/log4jruby/logger.rb
25
+ - lib/log4jruby/logger_for_class.rb
26
+ - lib/log4jruby/rails.rb
27
+ - lib/log4jruby/version.rb
34
28
  homepage: https://github.com/lenny/log4jruby
35
29
  licenses: []
36
-
37
- post_install_message:
30
+ metadata: {}
31
+ post_install_message:
38
32
  rdoc_options: []
39
-
40
- require_paths:
41
- - lib
42
- required_ruby_version: !ruby/object:Gem::Requirement
43
- none: false
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: "0"
48
- required_rubygems_version: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: "0"
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
54
45
  requirements: []
55
-
56
- rubyforge_project:
57
- rubygems_version: 1.8.24
58
- signing_key:
59
- specification_version: 3
46
+ rubyforge_project:
47
+ rubygems_version: 2.2.2
48
+ signing_key:
49
+ specification_version: 4
60
50
  summary: Log4jruby is a thin wrapper around the Log4j Logger. It is geared more toward those who are using JRuby to integrate with and build on top of Java code that uses Log4j. The Log4jruby::Logger provides an interface much like the standard ruby Logger. Your ruby loggers are given a .jruby prefix and can be configured along with the loggers for your Java code.
61
51
  test_files: []
62
-