loggr 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/.travis.yml +4 -4
- data/Appraisals +3 -3
- data/Gemfile.lock +27 -0
- data/gemfiles/{activesupport-3.0.x.gemfile → activesupport-3.0.gemfile} +0 -0
- data/gemfiles/activesupport-3.0.gemfile.lock +24 -0
- data/gemfiles/activesupport-3.1.gemfile.lock +27 -0
- data/gemfiles/activesupport-3.2.gemfile +7 -0
- data/gemfiles/activesupport-3.2.gemfile.lock +29 -0
- data/lib/loggr/factory.rb +1 -1
- data/lib/loggr/slf4j/logger.rb +8 -6
- data/lib/loggr/version.rb +1 -1
- data/loggr.gemspec +1 -1
- data/test/unit/slf4j/logger_test.rb +7 -0
- metadata +25 -22
- data/gemfiles/activesupport-head.gemfile +0 -7
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
appraise "activesupport-3.0
|
1
|
+
appraise "activesupport-3.0" do
|
2
2
|
gem 'activesupport', '~> 3.0.9'
|
3
3
|
end
|
4
4
|
|
@@ -6,6 +6,6 @@ appraise "activesupport-3.1" do
|
|
6
6
|
gem 'activesupport', '~> 3.1.0'
|
7
7
|
end
|
8
8
|
|
9
|
-
appraise "activesupport-
|
10
|
-
gem 'activesupport',
|
9
|
+
appraise "activesupport-3.2" do
|
10
|
+
gem 'activesupport', '~> 3.2.0'
|
11
11
|
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
loggr (1.1.2)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (3.1.1)
|
10
|
+
multi_json (~> 1.0)
|
11
|
+
appraisal (0.4.0)
|
12
|
+
bundler
|
13
|
+
rake
|
14
|
+
minitest (2.6.2)
|
15
|
+
multi_json (1.0.3)
|
16
|
+
rake (0.9.2)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
java
|
20
|
+
ruby
|
21
|
+
|
22
|
+
DEPENDENCIES
|
23
|
+
activesupport (>= 3.0.0)
|
24
|
+
appraisal (>= 0.4)
|
25
|
+
loggr!
|
26
|
+
minitest (>= 2.3.0)
|
27
|
+
rake (>= 0.8.7)
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/lukas/Projects/_github/loggr
|
3
|
+
specs:
|
4
|
+
loggr (1.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (3.0.11)
|
10
|
+
appraisal (0.4.0)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
minitest (2.10.1)
|
14
|
+
rake (0.9.2.2)
|
15
|
+
|
16
|
+
PLATFORMS
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
activesupport (~> 3.0.9)
|
21
|
+
appraisal (>= 0.4)
|
22
|
+
loggr!
|
23
|
+
minitest (>= 2.3.0)
|
24
|
+
rake (>= 0.8.7)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/lukas/Projects/_github/loggr
|
3
|
+
specs:
|
4
|
+
loggr (1.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (3.1.1)
|
10
|
+
multi_json (~> 1.0)
|
11
|
+
appraisal (0.4.0)
|
12
|
+
bundler
|
13
|
+
rake
|
14
|
+
minitest (2.6.2)
|
15
|
+
multi_json (1.0.3)
|
16
|
+
rake (0.9.2)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
java
|
20
|
+
ruby
|
21
|
+
|
22
|
+
DEPENDENCIES
|
23
|
+
activesupport (~> 3.1.0)
|
24
|
+
appraisal (>= 0.4)
|
25
|
+
loggr!
|
26
|
+
minitest (>= 2.3.0)
|
27
|
+
rake (>= 0.8.7)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/lukas/Projects/_github/loggr
|
3
|
+
specs:
|
4
|
+
loggr (1.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (3.2.0)
|
10
|
+
i18n (~> 0.6)
|
11
|
+
multi_json (~> 1.0)
|
12
|
+
appraisal (0.4.0)
|
13
|
+
bundler
|
14
|
+
rake
|
15
|
+
i18n (0.6.0)
|
16
|
+
minitest (2.10.1)
|
17
|
+
multi_json (1.0.4)
|
18
|
+
rake (0.9.2.2)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
java
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
activesupport (~> 3.2.0)
|
26
|
+
appraisal (>= 0.4)
|
27
|
+
loggr!
|
28
|
+
minitest (>= 2.3.0)
|
29
|
+
rake (>= 0.8.7)
|
data/lib/loggr/factory.rb
CHANGED
@@ -3,7 +3,7 @@ require 'loggr/adapter'
|
|
3
3
|
# This is basically a factory facade to create new Logger instances
|
4
4
|
# which behave all like standard Ruby Stdlib Loggers.
|
5
5
|
#
|
6
|
-
class LoggerFactory
|
6
|
+
class LoggerFactory
|
7
7
|
# Ensure we get all those factory methods directly here
|
8
8
|
extend Loggr::Adapter
|
9
9
|
end
|
data/lib/loggr/slf4j/logger.rb
CHANGED
@@ -100,12 +100,14 @@ module Loggr
|
|
100
100
|
|
101
101
|
protected
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
103
|
+
# Construct the message, note that progname will be ignored, maybe set as
|
104
|
+
# MDC?
|
105
|
+
#
|
106
|
+
# Removes leading newlines.
|
107
|
+
def build_message(message = nil, progname = nil, &block)
|
108
|
+
message = yield if message.nil? && block_given?
|
109
|
+
message.to_s.sub(/^\n+/, '')
|
110
|
+
end
|
109
111
|
end
|
110
112
|
end
|
111
113
|
end
|
data/lib/loggr/version.rb
CHANGED
data/loggr.gemspec
CHANGED
@@ -24,5 +24,5 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_development_dependency "rake", ">= 0.8.7"
|
25
25
|
s.add_development_dependency "minitest", ">= 2.3.0"
|
26
26
|
s.add_development_dependency "activesupport", ">= 3.0.0"
|
27
|
-
s.add_development_dependency "appraisal", ">= 0.
|
27
|
+
s.add_development_dependency "appraisal", ">= 0.4"
|
28
28
|
end
|
@@ -146,6 +146,13 @@ class Loggr::SLF4J::LoggerTest < MiniTest::Unit::TestCase
|
|
146
146
|
assert_equal Hash.new, @logger.java_mdc.to_hash
|
147
147
|
end
|
148
148
|
|
149
|
+
def test_strip_leading_newlines
|
150
|
+
skip_unless_jruby
|
151
|
+
assert_equal " some\nnewline\nmessage", @logger.send(:build_message, " some\nnewline\nmessage")
|
152
|
+
assert_equal "Started GET \"/service/dossiers\" for 127.0.0.1 at Wed Feb 15 22:28:02 +0100 2012", @logger.send(:build_message, "\n\nStarted GET \"/service/dossiers\" for 127.0.0.1 at Wed Feb 15 22:28:02 +0100 2012")
|
153
|
+
assert_equal "NoMethodError (missing foobar):\n backtrace1\n backtrace2\n\n", @logger.send(:build_message, "\n\nNoMethodError (missing foobar):\n backtrace1\n backtrace2\n\n")
|
154
|
+
end
|
155
|
+
|
149
156
|
def test_java_logger
|
150
157
|
skip_unless_jruby
|
151
158
|
refute_nil @logger.java_logger
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loggr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lukas Westermann
|
@@ -15,11 +15,9 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-02-15 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name: rake
|
22
|
-
prerelease: false
|
23
21
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
22
|
none: false
|
25
23
|
requirements:
|
@@ -31,11 +29,11 @@ dependencies:
|
|
31
29
|
- 8
|
32
30
|
- 7
|
33
31
|
version: 0.8.7
|
34
|
-
|
32
|
+
name: rake
|
35
33
|
version_requirements: *id001
|
36
|
-
|
37
|
-
name: minitest
|
34
|
+
type: :development
|
38
35
|
prerelease: false
|
36
|
+
- !ruby/object:Gem::Dependency
|
39
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
38
|
none: false
|
41
39
|
requirements:
|
@@ -47,11 +45,11 @@ dependencies:
|
|
47
45
|
- 3
|
48
46
|
- 0
|
49
47
|
version: 2.3.0
|
50
|
-
|
48
|
+
name: minitest
|
51
49
|
version_requirements: *id002
|
52
|
-
|
53
|
-
name: activesupport
|
50
|
+
type: :development
|
54
51
|
prerelease: false
|
52
|
+
- !ruby/object:Gem::Dependency
|
55
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
54
|
none: false
|
57
55
|
requirements:
|
@@ -63,11 +61,11 @@ dependencies:
|
|
63
61
|
- 0
|
64
62
|
- 0
|
65
63
|
version: 3.0.0
|
66
|
-
|
64
|
+
name: activesupport
|
67
65
|
version_requirements: *id003
|
68
|
-
|
69
|
-
name: appraisal
|
66
|
+
type: :development
|
70
67
|
prerelease: false
|
68
|
+
- !ruby/object:Gem::Dependency
|
71
69
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
70
|
none: false
|
73
71
|
requirements:
|
@@ -76,11 +74,12 @@ dependencies:
|
|
76
74
|
hash: 3
|
77
75
|
segments:
|
78
76
|
- 0
|
79
|
-
-
|
80
|
-
|
81
|
-
|
82
|
-
type: :development
|
77
|
+
- 4
|
78
|
+
version: "0.4"
|
79
|
+
name: appraisal
|
83
80
|
version_requirements: *id004
|
81
|
+
type: :development
|
82
|
+
prerelease: false
|
84
83
|
description: Adapters for different ruby logging backends. Create loggers using different adapters, like Logger (Stdlib), Rails or SLF4J (in JRuby only).
|
85
84
|
email:
|
86
85
|
- lukas@at-point.ch
|
@@ -95,13 +94,17 @@ files:
|
|
95
94
|
- .travis.yml
|
96
95
|
- Appraisals
|
97
96
|
- Gemfile
|
97
|
+
- Gemfile.lock
|
98
98
|
- LICENSES.md
|
99
99
|
- MIT-LICENSE
|
100
100
|
- README.md
|
101
101
|
- Rakefile
|
102
|
-
- gemfiles/activesupport-3.0.
|
102
|
+
- gemfiles/activesupport-3.0.gemfile
|
103
|
+
- gemfiles/activesupport-3.0.gemfile.lock
|
103
104
|
- gemfiles/activesupport-3.1.gemfile
|
104
|
-
- gemfiles/activesupport-
|
105
|
+
- gemfiles/activesupport-3.1.gemfile.lock
|
106
|
+
- gemfiles/activesupport-3.2.gemfile
|
107
|
+
- gemfiles/activesupport-3.2.gemfile.lock
|
105
108
|
- lib/logback-classic-0.9.29.jar
|
106
109
|
- lib/logback-core-0.9.29.jar
|
107
110
|
- lib/loggr.rb
|
@@ -168,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
171
|
requirements: []
|
169
172
|
|
170
173
|
rubyforge_project:
|
171
|
-
rubygems_version: 1.8.
|
174
|
+
rubygems_version: 1.8.15
|
172
175
|
signing_key:
|
173
176
|
specification_version: 3
|
174
177
|
summary: Logger factory framework (including an SLF4J wrapper)
|